mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 18:09:22 +02:00
update examples
This commit is contained in:
@ -77,13 +77,11 @@ impl Actor for ChatClient {
|
||||
self.hb(ctx)
|
||||
}
|
||||
|
||||
fn stopping(&mut self, _: &mut Context<Self>) -> bool {
|
||||
fn stopped(&mut self, _: &mut Context<Self>) {
|
||||
println!("Disconnected");
|
||||
|
||||
// Stop application on disconnect
|
||||
Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,10 +75,10 @@ impl Actor for WsChatSession {
|
||||
}).wait(ctx);
|
||||
}
|
||||
|
||||
fn stopping(&mut self, ctx: &mut Self::Context) -> bool {
|
||||
fn stopping(&mut self, ctx: &mut Self::Context) -> Running {
|
||||
// notify chat server
|
||||
ctx.state().addr.do_send(server::Disconnect{id: self.id});
|
||||
true
|
||||
Running::Stop
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,10 +58,10 @@ impl Actor for ChatSession {
|
||||
}).wait(ctx);
|
||||
}
|
||||
|
||||
fn stopping(&mut self, ctx: &mut Self::Context) -> bool {
|
||||
fn stopping(&mut self, ctx: &mut Self::Context) -> Running {
|
||||
// notify chat server
|
||||
self.addr.do_send(server::Disconnect{id: self.id});
|
||||
true
|
||||
Running::Stop
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user