pub struct ReconnectionConfig {
pub initial_delay: Duration,
pub max_delay: Duration,
pub max_attempts: Option<u32>,
pub backoff_multiplier: f64,
pub http2_keep_alive_interval: Option<Duration>,
}Expand description
Configuration for gRPC stream reconnection with exponential backoff
Fields§
§initial_delay: DurationInitial delay before first reconnection attempt
max_delay: DurationMaximum delay between reconnection attempts
max_attempts: Option<u32>Maximum number of reconnection attempts (None = infinite)
backoff_multiplier: f64Multiplier for exponential backoff (typically 2.0)
http2_keep_alive_interval: Option<Duration>HTTP/2 keep-alive interval to prevent silent disconnects
Implementations§
Source§impl ReconnectionConfig
impl ReconnectionConfig
pub fn new() -> Self
pub fn with_initial_delay(self, delay: Duration) -> Self
pub fn with_max_delay(self, delay: Duration) -> Self
pub fn with_max_attempts(self, attempts: u32) -> Self
pub fn with_backoff_multiplier(self, multiplier: f64) -> Self
pub fn with_http2_keep_alive_interval(self, interval: Duration) -> Self
Sourcepub fn next_backoff(&self, current: Duration) -> Duration
pub fn next_backoff(&self, current: Duration) -> Duration
Calculate the next backoff duration given the current one
Trait Implementations§
Source§impl Clone for ReconnectionConfig
impl Clone for ReconnectionConfig
Source§fn clone(&self) -> ReconnectionConfig
fn clone(&self) -> ReconnectionConfig
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 ReconnectionConfig
impl Debug for ReconnectionConfig
Auto Trait Implementations§
impl Freeze for ReconnectionConfig
impl RefUnwindSafe for ReconnectionConfig
impl Send for ReconnectionConfig
impl Sync for ReconnectionConfig
impl Unpin for ReconnectionConfig
impl UnwindSafe for ReconnectionConfig
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