mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 18:09:22 +02:00
subscriber to os signals automatically
This commit is contained in:
@ -10,7 +10,6 @@ extern crate env_logger;
|
||||
|
||||
use actix::*;
|
||||
use actix_web::*;
|
||||
use actix::actors::signal::{ProcessSignals, Subscribe};
|
||||
|
||||
/// do websocket handshake and start `MyWebSocket` actor
|
||||
fn ws_index(r: HttpRequest) -> Result<HttpResponse> {
|
||||
@ -71,10 +70,6 @@ fn main() {
|
||||
.bind("127.0.0.1:8080").unwrap()
|
||||
.start();
|
||||
|
||||
// Subscribe to unix signals
|
||||
let signals = actix::Arbiter::system_registry().get::<ProcessSignals>();
|
||||
signals.send(Subscribe(_addr.subscriber()));
|
||||
|
||||
println!("Started http server: 127.0.0.1:8080");
|
||||
let _ = sys.run();
|
||||
}
|
||||
|
Reference in New Issue
Block a user