Skip to main content

Module events_stream

Module events_stream 

Source
Expand description

(#6637) workstream.events: the socket transport’s live fan-out, a bridge onto the same sse::aggregate_live combinator the HTTP route uses. workstream.events — the streaming method a UDS client observes one workstream through (#6637).

Why: crate::workstreams::sse::routes serves the same fan-out over HTTP, and the TUI consumed it as SSE. The socket transport has no long-lived GET, so the fan-out is registered as a trusty_common::uds::server::RpcRouter::typed_stream method instead. The fan-out itself is NOT reimplemented — crate::workstreams::sse::aggregate_live stays the single definition of which events belong to a workstream, and this module is the bridge from its Stream onto the router’s channel.

What: open validates the id and the workstream’s existence exactly as workstream_events_sse does, then forwards crate::workstreams::WorkstreamEventEnvelopes until the client disconnects.

There is no after_seq here, and there cannot be. aggregate_live is live-only by construction: a workstream has no ring buffer of its own, only the per-session rings its bound sessions each hold, and those carry per-session seq values with no workstream-wide ordering to resume from. A client that reconnects re-subscribes bare and observes from that moment — the same contract the HTTP route always had. session.events’s resume is not portable to this method.

Test: crate::serve::uds_tests::stream_names_win_over_the_fallback pins the registration; the fan-out rules themselves are covered by sse_tests.

Structs§

WorkstreamEventsParams
workstream.events’ params.

Constants§

METHOD
The method name this stream is registered under.

Functions§

open
Open one workstream.events stream.