1 unstable release
0.9.2 | Jun 6, 2020 |
---|
#10 in #termination
3KB
A simple representation of a "pidfile".
Creates a pidfile on creation and automatically remove it on termination.
fn main() {
let pidfile = Pidfile::new("myserver.pid");
// .. run server ..
// On termination the Pidfile will automatically be removed.
}
Be mindful of the Drop
trait caveats; for instance calling
std::process::exit()
will cause Drop traits not to run.