Restart a Secondary Process when Signals Come In
Features
-
Triggers a process when a signal comes in.
-
If a new signal comes while the secondary process is running it gets killed and restarted.
-
Note that the abort happens when an
.awaitis reached. That happens at the lines:tokio::time::sleep(tokio::time::Duration::from_millis(540)).await;and
yield_now().await;The
yield_now().awaitis that I'm using in my static site builder since there's not a sleep function in it.
References
https://docs.rs/tokio/latest/tokio/task/index.html#yield_now