pub struct FixedDelay {
pub max_attempts: u32,
pub delay: Duration,
pub jitter: JitterStrategy,
}Expand description
Fixed delay retry strategy.
Retries with a constant delay between attempts.
§Example
use durable_execution_sdk::config::FixedDelay;
use durable_execution_sdk::Duration;
// Retry up to 3 times with 5 second delay between attempts
let strategy = FixedDelay::new(3, Duration::from_seconds(5));Fields§
§max_attempts: u32Maximum number of retry attempts.
delay: DurationDelay between retry attempts.
jitter: JitterStrategyJitter strategy applied to the fixed delay.
Implementations§
Source§impl FixedDelay
impl FixedDelay
Sourcepub fn new(max_attempts: u32, delay: Duration) -> Self
pub fn new(max_attempts: u32, delay: Duration) -> Self
Creates a new fixed delay retry strategy.
§Arguments
max_attempts- Maximum number of retry attemptsdelay- Delay between retry attempts
Sourcepub fn with_jitter(self, jitter: JitterStrategy) -> Self
pub fn with_jitter(self, jitter: JitterStrategy) -> Self
Sets the jitter strategy for retry delays.
Trait Implementations§
Source§impl Clone for FixedDelay
impl Clone for FixedDelay
Source§fn clone(&self) -> FixedDelay
fn clone(&self) -> FixedDelay
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 FixedDelay
impl Debug for FixedDelay
Source§impl RetryStrategy for FixedDelay
impl RetryStrategy for FixedDelay
Auto Trait Implementations§
impl Freeze for FixedDelay
impl RefUnwindSafe for FixedDelay
impl Send for FixedDelay
impl Sync for FixedDelay
impl Unpin for FixedDelay
impl UnsafeUnpin for FixedDelay
impl UnwindSafe for FixedDelay
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 moreCreates a shared type from an unshared type.