pub struct ResilientOptions {
pub manager_options: ManagerOptions,
pub buffer_size: usize,
pub enable_heartbeat: bool,
pub enable_watchdog: bool,
pub heartbeat_interval: u64,
pub watchdog_interval: u64,
pub max_retries: u32,
pub metrics: Option<ResilientMetrics>,
pub cumulative_attempts_counter: Option<Arc<AtomicU64>>,
}Expand description
Configuration options for resilient AMI connections
Fields§
§manager_options: ManagerOptionsBasic connection options
buffer_size: usizeBuffer size for event broadcaster (default: 2048)
enable_heartbeat: boolEnable heartbeat monitoring (default: true)
enable_watchdog: boolEnable automatic reconnection watchdog (default: true)
heartbeat_interval: u64Heartbeat interval in seconds (default: 30)
watchdog_interval: u64Watchdog check interval in seconds (default: 1)
max_retries: u32Maximum number of immediate reconnection attempts before adding delays.
Retry behavior: first max_retries attempts are immediate (no delay),
followed by one delayed attempt, then the counter resets and the cycle repeats.
Default: 3.
metrics: Option<ResilientMetrics>Optional metrics collection for monitoring reconnection behavior
cumulative_attempts_counter: Option<Arc<AtomicU64>>Global cumulative attempts counter shared across stream instances
Implementations§
Source§impl ResilientOptions
impl ResilientOptions
Sourcepub fn with_global_counter(self) -> Self
pub fn with_global_counter(self) -> Self
Create a new ResilientOptions with a shared global cumulative attempts counter. This ensures that cumulative attempt counts persist across stream recreation.
Trait Implementations§
Source§impl Clone for ResilientOptions
impl Clone for ResilientOptions
Source§fn clone(&self) -> ResilientOptions
fn clone(&self) -> ResilientOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more