pub struct StreamHealthMonitor { /* private fields */ }Expand description
Stream health monitor
Tracks stream activity and provides health status updates.
Implementations§
Source§impl StreamHealthMonitor
impl StreamHealthMonitor
Sourcepub fn new(config: StreamHealthConfig) -> Self
pub fn new(config: StreamHealthConfig) -> Self
Create a new stream health monitor
Sourcepub fn with_events(
config: StreamHealthConfig,
tx: Sender<StreamHealthEvent>,
) -> Self
pub fn with_events( config: StreamHealthConfig, tx: Sender<StreamHealthEvent>, ) -> Self
Create with event channel for notifications
Sourcepub fn record_activity(&self)
pub fn record_activity(&self)
Record activity on the stream
Sourcepub fn status(&self) -> StreamHealthStatus
pub fn status(&self) -> StreamHealthStatus
Get current stream status
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if stream is cancelled
Sourcepub fn idle_time_ms(&self) -> u64
pub fn idle_time_ms(&self) -> u64
Get time since last activity in milliseconds
Sourcepub fn check_health(&self) -> bool
pub fn check_health(&self) -> bool
Check stream health and update status
Returns true if stream is still healthy/recoverable
Sourcepub fn config(&self) -> &StreamHealthConfig
pub fn config(&self) -> &StreamHealthConfig
Get configuration
Sourcepub fn handle(&self) -> StreamHealthHandle
pub fn handle(&self) -> StreamHealthHandle
Create a handle for sharing across tasks
Auto Trait Implementations§
impl Freeze for StreamHealthMonitor
impl RefUnwindSafe for StreamHealthMonitor
impl Send for StreamHealthMonitor
impl Sync for StreamHealthMonitor
impl Unpin for StreamHealthMonitor
impl UnwindSafe for StreamHealthMonitor
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].