pub struct ConnectionManager { /* private fields */ }
Expand description
Main connection manager that orchestrates reconnection, heartbeat, and subscription management
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub fn new(
client: Weak<Mutex<LightstreamerClient>>,
reconnection_config: ReconnectionConfig,
heartbeat_config: HeartbeatConfig,
) -> Arc<Self>
pub fn new( client: Weak<Mutex<LightstreamerClient>>, reconnection_config: ReconnectionConfig, heartbeat_config: HeartbeatConfig, ) -> Arc<Self>
Creates a new connection manager
Sourcepub async fn start_monitoring(&self)
pub async fn start_monitoring(&self)
Starts the connection monitoring tasks
Sourcepub async fn handle_disconnection(&self, reason: DisconnectionReason)
pub async fn handle_disconnection(&self, reason: DisconnectionReason)
Handles disconnection and triggers reconnection if needed
Sourcepub async fn get_connection_state(&self) -> ConnectionState
pub async fn get_connection_state(&self) -> ConnectionState
Gets the current connection state
Sourcepub async fn get_metrics(&self) -> ConnectionMetrics
pub async fn get_metrics(&self) -> ConnectionMetrics
Gets connection metrics
Sourcepub async fn force_reconnect(&self) -> Result<(), ReconnectionError>
pub async fn force_reconnect(&self) -> Result<(), ReconnectionError>
Forces a reconnection attempt
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionManager
impl !RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl !UnwindSafe for ConnectionManager
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