pub struct RetryPolicy {
pub max_retries: u32,
pub backoff: BackoffStrategy,
}Expand description
Configurable retry policy for individual Axon transitions.
Fields§
§max_retries: u32Maximum number of retry attempts (not counting the initial attempt).
backoff: BackoffStrategyBackoff strategy between retries.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn fixed(max_retries: u32, delay: Duration) -> Self
pub fn fixed(max_retries: u32, delay: Duration) -> Self
Create a retry policy with fixed delay between attempts.
Sourcepub fn exponential(
max_retries: u32,
initial: Duration,
multiplier: f64,
max: Duration,
) -> Self
pub fn exponential( max_retries: u32, initial: Duration, multiplier: f64, max: Duration, ) -> Self
Create a retry policy with exponential backoff.
§Arguments
max_retries: Maximum number of retry attemptsinitial: Initial delay (e.g., 100ms)multiplier: Backoff multiplier (e.g., 2.0 for doubling)max: Maximum delay cap
Sourcepub fn exponential_default(max_retries: u32, initial_ms: u64) -> Self
pub fn exponential_default(max_retries: u32, initial_ms: u64) -> Self
Convenience: exponential backoff starting at initial_ms milliseconds,
doubling each time, capped at 30 seconds.
Sourcepub fn delay_for_attempt(&self, attempt: u32) -> Duration
pub fn delay_for_attempt(&self, attempt: u32) -> Duration
Calculate the delay for the given attempt number (0-indexed).
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
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 moreAuto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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