1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Connection management module.
//!
//! This module provides the core connection management functionality:
//!
//! - **Connector**: Establishes WebSocket connections
//! - **Supervisor**: Manages connection lifecycle and reconnection
//! - **State**: Tracks connection status and metrics
//! - **Retry**: Implements retry strategies
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │ ConnectionSupervisor │
//! │ │
//! │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
//! │ │ Connector │ │ State │ │ RetryStrategy │ │
//! │ │ │ │ │ │ │ │
//! │ │ connect() │ │ status │ │ next_delay() │ │
//! │ │ │ │ id │ │ reset() │ │
//! │ └─────────────┘ │ metrics │ └─────────────────────┘ │
//! │ └─────────────┘ │
//! │ │
//! │ Events: Connecting → Connected → Disconnected → Reconnect │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Example
//!
//! ```rust,ignore
//! use stream_tungstenite::connection::{
//! ConnectionSupervisor, SupervisorConfig, ExponentialBackoff
//! };
//!
//! // Create a supervisor with custom retry strategy
//! let config = SupervisorConfig::new()
//! .with_retry(ExponentialBackoff::fast());
//!
//! let supervisor = ConnectionSupervisor::new("wss://example.com/ws")
//! .with_config(config);
//!
//! // Subscribe to events
//! let mut events = supervisor.subscribe();
//!
//! // Connect
//! let stream = supervisor.connect().await?;
//! ```
pub use ;
pub use ;
pub use ;
pub use ;