Crate interruptor

Source
Expand description

Collection of functions generating Unix process signal receivers for use in the crossbeam_channel::select! macro.

§Example

let tick = tick(Duration::from_secs(1));
let stop = interruption_or_termination();

loop {
    select! {
        recv(tick) -> _ => println!("Running!"),
        recv(stop) -> _ => break,
    }
}

Enums§

Signal

Functions§

hang_up
Create receiver for SIGHUP signal.
interruption
Create receiver for SIGINT signal.
interruption_or_termination
Create (single) receiver for SIGINT and SIGTERM signal.
signal
Create (single) receiver for Unix process signals listed in signals.
termination
Create receiver for SIGTERM signal.