vorarbeiter

Crates.iovorarbeiter
lib.rsvorarbeiter
version0.1.0
sourcesrc
created_at2020-12-06 11:47:24.753424
updated_at2020-12-06 11:47:24.753424
descriptionA small process supervisor that shutdowns child processes
homepage
repositoryhttps://github.com/mbr/vorarbeiter-rs
max_upload_size
id320106
size6,311
Marc Brinkmann (mbr)

documentation

https://docs.rs/vorarbeiter

README

Vorarbeiter, a small process supervisor

vorarbeiter::Supervisor shuts down processes it owns on Drop by sending a SIGTERM first, followed by a SIGKILL:

use std::process;

// The default kill timeout is 10 seconds, which is fine here.
let mut supervisor = vorarbeiter::Supervisor::default();

// Spawns three new child processes and adds them to the supervisor.
for _ in 0..3 {
    let child = process::Command::new("my-subcommand").spawn().unwrap();
    supervisor.add_child(child);
}

// Terminate all child processes.
drop(supervisor);

See the documentation for details.

Commit count: 7

cargo fmt