Crates.io | uninterruptible |
lib.rs | uninterruptible |
version | 0.1.0 |
source | src |
created_at | 2021-04-12 11:28:39.041142 |
updated_at | 2021-04-12 11:28:39.041142 |
description | Guard type that keeps selected Unix signals suppressed |
homepage | https://sr.ht/~jpastuszek/uninterruptible/ |
repository | https://git.sr.ht/~jpastuszek/uninterruptible |
max_upload_size | |
id | 382347 |
size | 6,398 |
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.