pub struct ManagedWsConfig {
pub initial_backoff: Duration,
pub max_backoff: Duration,
pub max_retries: Option<u32>,
pub channel_capacity: usize,
pub ws_config: Option<WebsocketConfig>,
pub idle_timeout: Duration,
pub backoff_reset_after: Duration,
}Expand description
Fields§
§initial_backoff: DurationInitial delay before the first reconnect attempt.
Default: 1 second
max_backoff: DurationMaximum delay between reconnect attempts.
Default: 30 seconds
max_retries: Option<u32>Maximum number of consecutive reconnect attempts before giving up.
None means retry forever.
Default: None (infinite retries)
channel_capacity: usizeEvent channel buffer size. When the buffer is full and the consumer isn’t keeping up, new events are dropped to keep the WebSocket connection alive. A warning is logged when this happens.
Default: 10_000
ws_config: Option<WebsocketConfig>Underlying WebSocket connection config (e.g. handshake timeout).
idle_timeout: DurationForce a reconnect if no server message arrives within this window.
Protects against zombie connections — TCP keepalives and WebSocket ping/pong keep the socket nominally alive, but the server can stop sending data without closing. Without this, the handle sits on a dead stream indefinitely.
Duration::ZERO disables the timer. Cmd-path acks (subscribe, order
responses) DO count as server-pushed messages and reset the clock.
Default: 60 seconds
backoff_reset_after: DurationHow long a connection must stay up before the backoff state is
considered “stable” and the next disconnect starts from
initial_backoff again.
Without this, a zombie that accepts connections and immediately drops
would be hammered at initial_backoff forever — the server never gets
the exponential-backoff relief.
Default: 30 seconds
Implementations§
Source§impl ManagedWsConfig
impl ManagedWsConfig
Sourcepub fn builder() -> ManagedWsConfigBuilder
pub fn builder() -> ManagedWsConfigBuilder
Create an instance of ManagedWsConfig using the builder syntax
Trait Implementations§
Source§impl Clone for ManagedWsConfig
impl Clone for ManagedWsConfig
Source§fn clone(&self) -> ManagedWsConfig
fn clone(&self) -> ManagedWsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more