pub struct RetryConfig { /* private fields */ }Expand description
Configuration for retry behaviour on outbound HTTP calls.
All built-in subscribers share this configuration. Construct with
RetryConfig::new or use RetryConfig::default for sensible
defaults (3 attempts, 5 s timeout, 500 ms base backoff).
§Examples
use ironflow_engine::notify::RetryConfig;
let config = RetryConfig::default();
assert_eq!(config.max_retries(), 3);Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn new(max_retries: u32, timeout: Duration, base_backoff: Duration) -> Self
pub fn new(max_retries: u32, timeout: Duration, base_backoff: Duration) -> Self
Create a new retry configuration.
§Examples
use std::time::Duration;
use ironflow_engine::notify::RetryConfig;
let config = RetryConfig::new(5, Duration::from_secs(10), Duration::from_secs(1));
assert_eq!(config.max_retries(), 5);
assert_eq!(config.timeout(), Duration::from_secs(10));
assert_eq!(config.base_backoff(), Duration::from_secs(1));Sourcepub fn max_retries(&self) -> u32
pub fn max_retries(&self) -> u32
Maximum number of retry attempts.
Sourcepub fn base_backoff(&self) -> Duration
pub fn base_backoff(&self) -> Duration
Base delay for exponential backoff (doubled each retry).
Sourcepub fn build_client(&self) -> Client
pub fn build_client(&self) -> Client
Build an HTTP client configured with this timeout.
§Panics
Panics if the TLS backend is unavailable.
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§fn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
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 RetryConfig
impl Debug for RetryConfig
Auto Trait Implementations§
impl Freeze for RetryConfig
impl RefUnwindSafe for RetryConfig
impl Send for RetryConfig
impl Sync for RetryConfig
impl Unpin for RetryConfig
impl UnsafeUnpin for RetryConfig
impl UnwindSafe for RetryConfig
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