Expand description
Cooperative shutdown primitives.
ShutdownToken is a clonable, hierarchical cancellation primitive shared
between the ComponentRegistry,
every Component lifecycle phase,
and the future transport layer (added in M5).
Design goals:
- Cooperative, not preemptive: tasks opt-in by calling
ShutdownToken::waitor by pollingShutdownToken::is_shutdown. - Hierarchical: child tokens propagate a shutdown signal upward to their parent, so the entire process can be torn down from any component failure without each component needing to wire its own supervision.
- Cheap to clone: backpressure-free,
Arc-backed, safe to embed in every component without allocation pressure.
Structsยง
- Shutdown
Token - Hierarchical, cooperative shutdown token.