prcs 0.2.0

The Swiss Army knife for running processes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::status_constraints::MatchStatusCode;
use crate::{cli::Opts, status_constraints::StatusCode};

pub fn handle<F>(opts: &Opts, delegate: F) -> StatusCode
where
    F: Fn() -> StatusCode,
{
    let child_status = delegate();
    if opts.stall.iter().any(|stall| stall.matches(child_status)) {
        std::thread::park()
    }
    child_status
}