Trait actix::prelude::Supervised[][src]

pub trait Supervised: Actor {
    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

Called when the supervisor restarts a failed actor.