pub enum SupervisionStrategy {
Stop,
Restart(RestartConfig),
Escalate,
}Expand description
Supervision strategy for handling actor failures.
Strategies form a lattice compatible with the Outcome severity model:
Stopis the default for unhandled failuresRestartcan recover from transient failuresEscalatepropagates failures up the region hierarchy
§Monotonicity
Supervision decisions are monotone: once an outcome is determined to be
severe (e.g., Panicked), it cannot be downgraded by supervision. A
restart that itself fails escalates the severity.
Variants§
Stop
Stop the actor immediately on any error.
The actor’s on_stop is called, and the failure is recorded.
The region continues running other tasks.
Restart(RestartConfig)
Restart the actor on error with configurable limits.
Restarts are rate-limited by a sliding window. If the restart
limit is exceeded, the strategy escalates to SupervisionStrategy::Stop.
Escalate
Escalate the failure to the parent region.
The parent region’s supervision policy handles the failure.
If there is no parent (root region), this behaves like SupervisionStrategy::Stop.
Trait Implementations§
Source§impl Clone for SupervisionStrategy
impl Clone for SupervisionStrategy
Source§fn clone(&self) -> SupervisionStrategy
fn clone(&self) -> SupervisionStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more