Trait actix::Supervised

source ·
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§

source

fn restarting(&mut self, ctx: &mut <Self as Actor>::Context)

Called when the supervisor restarts a failed actor.

Object Safety§

This trait is not object safe.

Implementors§