uninterruptible

Crates.iouninterruptible
lib.rsuninterruptible
version0.1.0
sourcesrc
created_at2021-04-12 11:28:39.041142
updated_at2021-04-12 11:28:39.041142
descriptionGuard type that keeps selected Unix signals suppressed
homepagehttps://sr.ht/~jpastuszek/uninterruptible/
repositoryhttps://git.sr.ht/~jpastuszek/uninterruptible
max_upload_size
id382347
size6,398
Jakub Pastuszek (jpastuszek)

documentation

https://docs.rs/uninterruptible

README

Latest Version Documentation License

Guard type that keeps selected Unix signals suppressed.

use uninterruptible::Uninterruptible;

// catch terminate signals (SIGTERM, SIGQUIT, SIGINT)
let u = Uninterruptible::terminate()?;

// do work, e.g. call in sub-process

u.checkpoint()?; // fails if the process recived one of the terminate signals (e.g. CTRL-C was pressed)


drop(u); // revert to default signal handlers

See module level documentation on docs.rs for more examples.

Commit count: 0

cargo fmt