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
//! # Public runtime ownership
//!
//! [`RuntimeOwner`] is the shared lease held by [`Supervisor`](crate::Supervisor) and every [`SupervisorHandle`](crate::SupervisorHandle).
//!
//! ```text
//! Supervisor ────────────┐
//! SupervisorHandle ──────┼── Arc<RuntimeOwner> ── Arc<SupervisorCore>
//! cloned handles ────────┘
//!
//! internal workers ────────────────────────────── Arc<SupervisorCore>
//! ```
//!
//! Internal workers retain the runtime core directly, but they do not retain `RuntimeOwner`.
//! The last public owner can therefore disappear while cleanup work still holds the core alive.
//!
//! Dropping that last owner cannot wait for graceful cleanup.
//! It invokes [`SupervisorCore::abandon`] to close runtime intake and propagate cancellation.
//! If an explicit shared shutdown operation already exists, that operation keeps ownership of cleanup and the fallback does not replace it.
use Arc;
use SupervisorCore;
/// Shared ownership held by `Supervisor` and every management handle.
///
/// Internal workers do not hold this value.
/// Its destructor therefore runs when the last public owner disappears and starts best-effort runtime cancellation.
pub
/// Omits runtime internals from the ownership lease's debug representation.
/// Starts the non-blocking last-owner fallback.
///
/// `Drop` cannot await joins or return a shutdown result.
/// Confirmed cleanup must go through [`SupervisorHandle::shutdown`](crate::SupervisorHandle::shutdown).