1
0
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:
Nikolay Kim
2018-01-05 16:32:36 -08:00
parent 473ec38439
commit 3ed9e872ad
17 changed files with 81 additions and 214 deletions

View File

@ -18,7 +18,6 @@ use std::time::Instant;
use actix::*;
use actix_web::*;
use actix::actors::signal::{ProcessSignals, Subscribe};
mod codec;
mod server;
@ -213,10 +212,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();
}