pub trait Supervised: Actor {
// Provided method
fn restarting(&mut self, ctx: &mut <Self as Actor>::Context) { ... }
}
Expand description
Actors with the ability to restart after failure.
Supervised actors can be managed by a
Supervisor
. As an additional lifecycle
event, the restarting
method can be implemented.
If a supervised actor fails, its supervisor creates new execution
context and restarts the actor, invoking its restarting
method.
After a call to this method, the actor’s execution state changes
to Started
and the regular lifecycle process starts.
The restarting
method gets called with the newly constructed
Context
object.
Provided Methods§
Sourcefn restarting(&mut self, ctx: &mut <Self as Actor>::Context)
fn restarting(&mut self, ctx: &mut <Self as Actor>::Context)
Called when the supervisor restarts a failed actor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.