pub struct RunTraceSubscriber {
pub host_client_id: String,
/* private fields */
}Expand description
One live runs.trace.event subscriber — the producer side of the
bounded channel whose drain task writes frames to the subscriber’s
WebSocket (agent run tracing, U4).
Keyed in crate::session::ServerState::run_subscribers by
(run_id, host_client_id) so two CarHost windows on the same run are
independent streams (the explicit fanout the single-subscriber-
per-method notification registry can’t provide), and so disconnect
cleanup can drop exactly this connection’s subscriptions.
The producer holds ONLY the tx and calls RunTraceSubscriber::push
— a non-blocking try_send. It never touches the WS socket, so a slow
CarHost can never stall the recorder, the runs lock, or any other
in-flight RPC (invariant #2). The dedicated drain task owns the socket
write.
Fields§
§host_client_id: StringThe connection that subscribed — its WS client_id.
Implementations§
Source§impl RunTraceSubscriber
impl RunTraceSubscriber
Sourcepub fn spawn(host_client_id: String, channel: Arc<WsChannel>) -> Self
pub fn spawn(host_client_id: String, channel: Arc<WsChannel>) -> Self
Spawn a drain task bound to channel and return the producer-side
subscriber handle. The drain task serializes each
runs.trace.event to a JSON-RPC notification frame and writes it
to the subscriber’s WS; it exits when the tx is dropped (the
subscriber is removed on unsubscribe / disconnect) — at which point
the channel closes and recv() returns None.
Sourcepub fn push(&self, event: RunTraceEvent) -> bool
pub fn push(&self, event: RunTraceEvent) -> bool
Non-blocking push of one event onto the drain channel. Returns
false when the channel is full (a wedged subscriber) — the event
is dropped rather than blocking the producer (invariant #2). The
producer treats the drop as best-effort: the client detects the
resulting cursor gap and re-subscribes to backfill (R8).
Auto Trait Implementations§
impl Freeze for RunTraceSubscriber
impl RefUnwindSafe for RunTraceSubscriber
impl Send for RunTraceSubscriber
impl Sync for RunTraceSubscriber
impl Unpin for RunTraceSubscriber
impl UnsafeUnpin for RunTraceSubscriber
impl UnwindSafe for RunTraceSubscriber
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more