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
53
54
55
56
57
58
59
60
61
62
63
64
65
use Any;
use Arc;
use async_trait;
use Result;
/// Capability trait for components that produce a long-running runtime task.
///
/// `run()` is the only place in the lifecycle for long-running work: accept
/// loops, listeners, periodic tickers. It does not appear in `register()` or
/// `Bootable::boot()`.
///
/// `D` is the runnable's typed dependency set (the component's `Deps` for the
/// default single instance). The runtime resolves it before each admitted
/// generation, after checking scope and activation policy. Dormant services
/// do not require runtime dependencies until started. Each execution receives
/// shared handles; fleet dispatch clones those handles across its slots.
///
/// The supplied [`crate::RunContext`] belongs to one live service generation.
/// Observe its cancellation rather than the process shutdown token alone: the
/// runtime uses the same path for a targeted stop or restart and for
/// whole-process shutdown.