pub struct RetryPolicy {
pub max_retries: u32,
pub base_delay: Duration,
pub max_delay: Duration,
pub jitter: f64,
}Expand description
Declarative backoff policy governing automatic retry of failed node executions.
Domain-free port of the shape battle-tested in the reference consumer (llm-net’s
graph/retry.rs): exponential backoff from base_delay to a max_delay ceiling with
symmetric jitter to prevent lockstep retries across parallel fan-outs.
Fields§
§max_retries: u32How many times a failed execution is re-attempted after the initial failure.
0 disables retry entirely.
base_delay: DurationThe initial backoff delay, doubled per attempt.
max_delay: DurationThe hard ceiling for any single backoff delay.
jitter: f64Symmetric randomization factor applied to each delay (e.g. 0.25 = ±25%).
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub const fn with_max_retries(self, max_retries: u32) -> Self
pub const fn with_max_retries(self, max_retries: u32) -> Self
Overrides the retry budget.
Sourcepub const fn with_base_delay(self, base_delay: Duration) -> Self
pub const fn with_base_delay(self, base_delay: Duration) -> Self
Overrides the initial backoff delay.
Sourcepub const fn with_max_delay(self, max_delay: Duration) -> Self
pub const fn with_max_delay(self, max_delay: Duration) -> Self
Overrides the backoff ceiling.
Sourcepub const fn with_jitter(self, jitter: f64) -> Self
pub const fn with_jitter(self, jitter: f64) -> Self
Overrides the jitter factor (0.0 disables randomization).
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§impl<'de> Deserialize<'de> for RetryPolicy
impl<'de> Deserialize<'de> for RetryPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
Source§impl Serialize for RetryPolicy
impl Serialize for RetryPolicy
impl StructuralPartialEq for RetryPolicy
Auto 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