1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-30 12:00:38 +00:00

Added ws::Message::Nop, no-op websockets message

This commit is contained in:
Nikolay Kim 2019-03-29 18:22:49 -07:00
parent c126713f40
commit 3220777ff9
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,10 @@
# Changes # 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 ### Changed

View file

@ -18,6 +18,8 @@ pub enum Message {
Pong(String), Pong(String),
/// Close message with optional reason /// Close message with optional reason
Close(Option<CloseReason>), Close(Option<CloseReason>),
/// No-op. Useful for actix-net services
Nop,
} }
/// `WebSocket` frame /// `WebSocket` frame
@ -87,6 +89,7 @@ impl Encoder for Codec {
Parser::write_message(dst, txt, OpCode::Pong, true, !self.server) Parser::write_message(dst, txt, OpCode::Pong, true, !self.server)
} }
Message::Close(reason) => Parser::write_close(dst, reason, !self.server), Message::Close(reason) => Parser::write_close(dst, reason, !self.server),
Message::Nop => (),
} }
Ok(()) Ok(())
} }