Daemon Utilities by actix.
```rust use actix::prelude::*; use actixdaemonutils::{ graceful_stop::{GracefulStop}, looper::{Looper, Task}, }
struct MyActor { msg: String, seconds: u64 }
impl Actor for MyActor {
type Context = Context
impl Handler
fn handle(&mut self, _msg: Task, _ctx: &mut Self::Context) -> Self::Result {
println!("{}", self.msg);
self.seconds
}
}
fn main() { let sys = actix::System::new("main"); let gracefulstop = GracefulStop::new(); let actor1 = MyActor { msg: "x".tostring(), seconds: 1 }.start(); let actor2 = MyActor { msg: "y".tostring(), seconds: 3 }.start(); let looper1 = Looper::new(actor1.recipient(), gracefulstop.clonesystemterminator()).start(); let looper2 = Looper::new(actor2.recipient(), gracefulstop.clonesystemterminator()).start(); gracefulstop .subscribe(looper1.recipient()) .subscribe(looper2.recipient()) .start();
let _ = sys.run();
println!("main terminated");
} ```