Expand description
Lifecycle supervision and shutdown coordination. Lifecycle + supervision primitives.
This module provides a small set of std-only coordination helpers intended for long-running services:
Shutdown/ShutdownToken: cooperative shutdown signaling.Supervisor: spawn and join supervised threads, optionally restartable with backoff.
§Contracts
- These primitives coordinate control flow (shutdown / join), not data synchronization.
- Child tasks must be written to observe shutdown and return in a bounded amount of time.
Supervisor::join_alldrains the supervisor’s child list; it is intended to be called once.
Structs§
- Shutdown
- Shutdown coordinator.
- Shutdown
Token - A clonable shutdown token that tasks can poll or wait on.
- Supervisor
- A minimal supervisor that coordinates shutdown and tracks child threads.
- Supervisor
Config - Supervisor configuration.