grace 0.1.0

Intercept shutdown requests in a portable way
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use grace::{ShutdownGuard, ShutdownType};

fn main() {
    {
        let (_guard, rx) =
            ShutdownGuard::new_channel(&[ShutdownType::Interrupt, ShutdownType::Terminate]);
        println!("Hello, world!");
        let type_ = rx.recv().unwrap();
        println!("{:?}", type_);
    }
    std::thread::park();
}