Skip to main content

Module stream

Module stream 

Source
Expand description

Streaming / subscription primitives.

Implements spec.md §5 / ADR-001 §5. The TypeScript on*(id, handler) -> unsubscribe pattern becomes streams + a uniform RAII Subscription guard:

  • process stdout/stderr, shell data, session events, permission requests, cron events -> tokio::sync::broadcast (multi-subscriber; no replay).
  • process exit -> tokio::sync::watch seeded None (already-exited branch fires immediately because the watch already holds Some(code)).
  • permission responder + internal single-reply correlation -> tokio::sync::oneshot.

Structs§

ByteStream
A byte stream over a broadcast channel (process stdout/stderr, shell data).
Subscription
RAII guard returned by on_* register methods. Dropping it deregisters the subscription.