mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 09:42:57 +01:00
update examples
This commit is contained in:
parent
7b0e1642b6
commit
d31e71a169
@ -94,6 +94,7 @@ version_check = "0.1"
|
|||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
codegen-units = 1
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
|
@ -77,13 +77,11 @@ impl Actor for ChatClient {
|
|||||||
self.hb(ctx)
|
self.hb(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stopping(&mut self, _: &mut Context<Self>) -> bool {
|
fn stopped(&mut self, _: &mut Context<Self>) {
|
||||||
println!("Disconnected");
|
println!("Disconnected");
|
||||||
|
|
||||||
// Stop application on disconnect
|
// Stop application on disconnect
|
||||||
Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||||
|
|
||||||
true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,10 +75,10 @@ impl Actor for WsChatSession {
|
|||||||
}).wait(ctx);
|
}).wait(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stopping(&mut self, ctx: &mut Self::Context) -> bool {
|
fn stopping(&mut self, ctx: &mut Self::Context) -> Running {
|
||||||
// notify chat server
|
// notify chat server
|
||||||
ctx.state().addr.do_send(server::Disconnect{id: self.id});
|
ctx.state().addr.do_send(server::Disconnect{id: self.id});
|
||||||
true
|
Running::Stop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,10 +58,10 @@ impl Actor for ChatSession {
|
|||||||
}).wait(ctx);
|
}).wait(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stopping(&mut self, ctx: &mut Self::Context) -> bool {
|
fn stopping(&mut self, ctx: &mut Self::Context) -> Running {
|
||||||
// notify chat server
|
// notify chat server
|
||||||
self.addr.do_send(server::Disconnect{id: self.id});
|
self.addr.do_send(server::Disconnect{id: self.id});
|
||||||
true
|
Running::Stop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,13 +66,11 @@ impl Actor for ChatClient {
|
|||||||
self.hb(ctx)
|
self.hb(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stopping(&mut self, _: &mut Context<Self>) -> bool {
|
fn stopped(&mut self, _: &mut Context<Self>) {
|
||||||
println!("Stopping");
|
println!("Disconnected");
|
||||||
|
|
||||||
// Stop application on disconnect
|
// Stop application on disconnect
|
||||||
Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||||
|
|
||||||
true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user