Skip to main content

subscribe_diagnostics

Function subscribe_diagnostics 

Source
pub async fn subscribe_diagnostics<F, Fut>(
    rpc_endpoint: &str,
    on_notification: F,
) -> Result<DiagnosticSubscriptionHandle, SubscriptionError>
where F: Fn(DiagnosticNotification) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,
Expand description

Subscribe to the session’s /diagnostic samples.

Probes are registered at creation (diagnostic_probes in CreateSessionParams); this only attaches the consumer. Callbacks run one at a time, in order. Never reconnects: a dropped WebSocket ends the stream with SubscriptionRuntimeError::Closed.

§Errors

SubscriptionError if the subscription cannot be started.