1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 18:09:22 +02:00

no need for StreamHandler

This commit is contained in:
Nikolay Kim
2018-01-06 01:06:35 -08:00
parent 3ed9e872ad
commit 247c23c1ea
8 changed files with 31 additions and 55 deletions

View File

@ -24,17 +24,7 @@ impl Actor for MyWebSocket {
type Context = HttpContext<Self>;
}
/// Standard actix's stream handler for a stream of `ws::Message`
impl StreamHandler<ws::Message> for MyWebSocket {
fn started(&mut self, ctx: &mut Self::Context) {
println!("WebSocket session openned");
}
fn finished(&mut self, ctx: &mut Self::Context) {
println!("WebSocket session closed");
}
}
/// Handler for `ws::Message`
impl Handler<ws::Message> for MyWebSocket {
type Result = ();