mirror of
https://github.com/actix/actix-web.git
synced 2024-12-21 07:36:43 +00:00
Added ws::Message::Nop, no-op websockets message
This commit is contained in:
parent
c126713f40
commit
3220777ff9
2 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
|||
# Changes
|
||||
|
||||
## [0.1.0-alpha.2] - 2019-xx-xx
|
||||
## [0.1.0-alpha.2] - 2019-03-29
|
||||
|
||||
### Added
|
||||
|
||||
* Added ws::Message::Nop, no-op websockets message
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ pub enum Message {
|
|||
Pong(String),
|
||||
/// Close message with optional reason
|
||||
Close(Option<CloseReason>),
|
||||
/// No-op. Useful for actix-net services
|
||||
Nop,
|
||||
}
|
||||
|
||||
/// `WebSocket` frame
|
||||
|
@ -87,6 +89,7 @@ impl Encoder for Codec {
|
|||
Parser::write_message(dst, txt, OpCode::Pong, true, !self.server)
|
||||
}
|
||||
Message::Close(reason) => Parser::write_close(dst, reason, !self.server),
|
||||
Message::Nop => (),
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue