pub enum Backoff {
Fixed(Duration),
Linear(Duration),
Exponential(Duration),
ExponentialJitter(Duration),
Custom(Box<dyn Fn(i32) -> DateTime<Utc> + Send + Sync>),
}Expand description
A backoff strategy for retrying jobs.
Variants§
Fixed(Duration)
Fixed delay duration
Linear(Duration)
Linear backoff based on attempt number
Exponential(Duration)
Exponential backoff with a base duration
ExponentialJitter(Duration)
Exponential with jitter
Custom(Box<dyn Fn(i32) -> DateTime<Utc> + Send + Sync>)
Custom backoff strategy
Implementations§
Auto Trait Implementations§
impl Freeze for Backoff
impl !RefUnwindSafe for Backoff
impl Send for Backoff
impl Sync for Backoff
impl Unpin for Backoff
impl UnsafeUnpin for Backoff
impl !UnwindSafe for Backoff
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> 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