pub enum ActorRestartStrategy {
Immediate,
LinearBackOff {
timeout: Duration,
},
ExponentialBackOff {
timeout: Duration,
multiplier: f64,
},
}Expand description
The strategy for restating an actor as far as it returned an failure.
The default strategy is Immediate.
Variants§
Immediate
Restart an actor as soon as possible, since the moment the actor finished with a failure.
LinearBackOff
Restart an actor after with the timeout. Each next restart is increasing on the given duration.
ExponentialBackOff
Restart an actor after with the timeout. Each next timeout is increasing exponentially. When passed a multiplier that equals to 1, the strategy works as the linear back off strategy. Passing the multiplier that equals to 0 leads to constant restart delays which is equal to the given timeout.
Implementations§
Trait Implementations§
Source§impl Clone for ActorRestartStrategy
impl Clone for ActorRestartStrategy
Source§fn clone(&self) -> ActorRestartStrategy
fn clone(&self) -> ActorRestartStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActorRestartStrategy
impl Debug for ActorRestartStrategy
Source§impl Default for ActorRestartStrategy
impl Default for ActorRestartStrategy
Source§impl PartialEq for ActorRestartStrategy
impl PartialEq for ActorRestartStrategy
impl StructuralPartialEq for ActorRestartStrategy
Auto Trait Implementations§
impl Freeze for ActorRestartStrategy
impl RefUnwindSafe for ActorRestartStrategy
impl Send for ActorRestartStrategy
impl Sync for ActorRestartStrategy
impl Unpin for ActorRestartStrategy
impl UnwindSafe for ActorRestartStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more