Expand description
Parent-child task lifecycle coupling.
HierarchyTracker maintains the parent → children mapping and enforces
lifecycle rules:
- Cascading cancellation: canceling a parent cascades to all non-terminal
descendants via
HierarchyTracker::collect_cancellation_cascade. - Orphan prevention:
HierarchyTracker::register_childrejects children of tasks already marked terminal. - Depth limit: configurable maximum nesting depth (default 8 levels).
§Invariants
- Tree structure is acyclic by construction (only append, no reparenting).
- Terminal state is tracked via
HierarchyTracker::mark_terminal, called by the dispatch loop after all runs for a task reach terminal state. - At bootstrap, tree registration happens before terminal marking, so orphan prevention never fires during WAL replay.
Structs§
- Hierarchy
Tracker - Tracks parent-child task relationships and enforces lifecycle coupling.
Enums§
- Hierarchy
Error - Error returned when registering a parent-child relationship fails.
Constants§
- DEFAULT_
MAX_ DEPTH - Default maximum nesting depth for task hierarchies.