/// Sets the actor restart strategy the supervisor should use
/// of its supervised children groups or supervisors dies to
/// restore in the correct state.
///
/// The default strategy is the [`ActorRestartStrategy::Immediate`] and
/// unlimited amount of retries.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// # use std::time::Duration;
/// #
/// # fn main() {
///     # Bastion::init();
///     # Bastion::supervisor(|sp| {
///     sp.with_restart_strategy(
///         RestartStrategy::default()
///             .with_restart_policy(RestartPolicy::Tries(5))
///             .with_actor_restart_strategy(           
///                 ActorRestartStrategy::ExponentialBackOff {
///                     timeout: Duration::from_millis(5000),
///                     multiplier: 3,
///                 }
///             )
///     )
/// }).expect("Couldn't create the supervisor");
///     #
///     # Bastion::start();
///     # Bastion::stop();
///     # Bastion::block_until_stopped();
/// # }
/// ```
Sets the actor restart strategy the supervisor should use
of its supervised children groups or supervisors dies to
restore in the correct state.

The default strategy is the [`ActorRestartStrategy::Immediate`] and
unlimited amount of retries.
Sets the actor restart strategy the supervisor should use of its supervised children groups or supervisors dies to restore in the correct state . The default strategy is the [ ` ActorRestartStrategy :: Immediate ` ] and unlimited amount of retries .
pub fn with_restart_strategy(mut self, restart_strategy: RestartStrategy) -> Self {
        trace!(
            "Supervisor({}): Setting actor restart strategy: {:?}",
            self.id(),
            restart_strategy
        );
        self.restart_strategy = restart_strategy;
        self
    }
pub fn with_restart_strategy ( mut self , restart_strategy : RestartStrategy ) -> Self { trace ! ( " " self id ( ) restart_strategy ) ; self . restart_strategy = restart_strategy ; self }
Sets the actor restart strategy the supervisor should use
of its supervised children groups or supervisors dies to
restore in the correct state.
Sets the actor restart strategy the supervisor should use of its supervised children groups or supervisors dies to restore in the correct state .
mut self
restart_strategy
RestartStrategy
example
None
use bastion::prelude::*;
None
use std::time::duration;
None
fn main() {
:init();
Bastion::supervisor(|sp| {
sp.with_restart_strategy(
RestartStrategy::default()
.with_restart_policy(RestartPolicy::Tries(5))
.with_actor_restart_strategy(
ActorRestartStrategy::ExponentialBackOff {
timeout: Duration::from_millis(5000),
multiplier: 3,
}
)
)
}).expect("Couldn't create the supervisor").

:start();
Bastion::stop();
Bastion::block_until_stopped().
: init () ; Bastion :: supervisor ( |sp| { sp . with_restart_strategy ( RestartStrategy :: default () . with_restart_policy ( RestartPolicy :: Tries ( 5 )) . with_actor_restart_strategy ( ActorRestartStrategy :: ExponentialBackOff { timeout : Duration :: from_millis ( 5000 ) multiplier : 3 } ) ) } ) . expect ( " Couldn ' t create the supervisor " ) . : start () ; Bastion :: stop () ; Bastion :: block_until_stopped () .
}
None