pub struct HealthMonitor { /* private fields */ }Expand description
Health monitor for tracking stream status and connectivity
Implementations§
Source§impl HealthMonitor
impl HealthMonitor
pub fn new(config: HealthConfig) -> Self
Sourcepub async fn start(&self) -> JoinHandle<()>
pub async fn start(&self) -> JoinHandle<()>
Start the health monitoring background task
Sourcepub async fn record_event(&self)
pub async fn record_event(&self)
Record that an event was received from the stream
Sourcepub async fn record_connection(&self)
pub async fn record_connection(&self)
Record that the stream connection was established
Sourcepub async fn record_disconnection(&self)
pub async fn record_disconnection(&self)
Record that the stream disconnected
Sourcepub async fn record_reconnecting(&self)
pub async fn record_reconnecting(&self)
Record that the stream is attempting to reconnect
Sourcepub async fn record_error(&self, error: String)
pub async fn record_error(&self, error: String)
Record an error from the stream
Sourcepub async fn is_healthy(&self) -> bool
pub async fn is_healthy(&self) -> bool
Check if the stream is currently healthy
Sourcepub async fn status(&self) -> StreamStatus
pub async fn status(&self) -> StreamStatus
Get the current stream status
Sourcepub async fn error_count(&self) -> u32
pub async fn error_count(&self) -> u32
Get the current error count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HealthMonitor
impl !RefUnwindSafe for HealthMonitor
impl Send for HealthMonitor
impl Sync for HealthMonitor
impl Unpin for HealthMonitor
impl !UnwindSafe for HealthMonitor
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