Skip to main content

Module stream_mount

Module stream_mount 

Source
Expand description

VFS Mount for streaming data — streams as 9P files (epic #809 W3, #819).

/stream/{topic}/data — read stream data (sequential, blocks until data/EOF) /stream/{topic}/info — read stream metadata (JSON) /stream/{topic}/qos — read/select QoS (StreamOpt vocabulary as tokens) /stream/{topic}/ctl — write control commands (cancel, qos …, resume …)

Follows Plan 9 /net/tcp/{n}/data pattern. Streams are created by dispatching streaming RPC methods via RpcClient::open_stream() and registered in the StreamRegistry.

§Interface, not a byte-copy path (#819)

This mount is the interface: naming, addressing, and open-time authorization. It is not a memcpy path that replaces the moq carrier. The registered [StreamHandle] IS the moq carrier subscription established at open — QUIC-native delivery (per-object streams, drop-stale, datagram, relay rendezvous) stays intact underneath. Two consumption modes ride the same handle:

  • Floor (Tread on data): blocking push semantics, exactly Plan 9 /net/tcp/n/data. Always works; correct and sufficient for low-rate streams (tokens). This is the floor, not the ceiling.
  • Carrier handle (bulk): high-rate / bulk consumers take the carrier-backed handle directly (StreamRegistry::take_handle) and drive the moq subscriber, exactly as #817 hands out mmap-at-open for weights. The frames are never routed one-by-one through Tread — that would flatten moq’s non-fungible delivery semantics to a lowest-common- denominator read, the anti-pattern this design exists to avoid.

QoS that does not reduce to reliable-in-order is selected through a small vocabulary (StreamQos) on qos / ctl — StreamOpt’s existing encoding (latest-wins, lossy-ok, drop-stale) moved onto the file, so the carrier’s rich semantics stay first-class through the interface.

Events (group-keyed EventService, #600) ride this same surface via StreamKind::Event rather than a separate plane — see StreamEntry.

Structs§

StreamEntry
Metadata and state for an active stream.
StreamMount
VFS mount for streaming data pipes.
StreamQos
The consumer-selectable QoS vocabulary, wired from StreamOpt onto the file.
StreamRegistry
Registry of active streams, keyed by topic.

Enums§

StreamKind
Which plane a registered topic belongs to.