1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! The steps that stop a child: signals, each with a grace period, and then
//! a kill.
use Duration;
use crateSignal;
/// How a run stops its child: each step sends a signal to the group and
/// waits its grace for the child to exit, and a kill follows the last step.
///
/// The default escalation has no steps, so a stop kills at once. Each caller
/// states its own steps, because a graceful signal helps only a child that
/// handles it:
///
/// ```
/// use std::time::Duration;
///
/// use crumbkit_process::{Escalation, Signal};
///
/// let polite = Escalation::default()
/// .step(Signal::Interrupt, Duration::from_secs(2))
/// .step(Signal::Terminate, Duration::from_secs(5));
/// assert_ne!(polite, Escalation::default());
/// ```
///
/// On Windows a stop skips the steps and ends the job at once (ADR-0171).