process_guard

Crates.ioprocess_guard
lib.rsprocess_guard
version0.2.0
sourcesrc
created_at2018-06-21 17:10:25.439358
updated_at2018-06-21 18:57:50.596591
descriptionGuard a process by terminating it on drop
homepage
repositoryhttps://github.com/49nord/process_guard-rs
max_upload_size
id71112
size7,617
Marc Brinkmann (mbr)

documentation

https://docs.rs/process_guard

README

process_guard

A process guard takes ownership of a process::Child and gently or forcefully kills it upon, prevent the process from running on. Example:

use process_guard::ProcessGuard;
use std::process;

fn insomnia() {
   let cmd = process::Command::new("sleep").arg("120");
   let pg = ProcessGuard::spawn(cmd);

   // a two-minute sleep process has been started, which will be killed as soon as this
   // function returns
}

OS support

The crate is currently only developed with Linux in mind. Windows/BSD/Mac OS X ports are appreciated

Commit count: 15

cargo fmt