streaming Package
Unified streaming primitive — <xref:EventStream> Protocol +
streams registry.
Pick a backing once at app startup via one of the registry's three
use_* configurators, then obtain stream instances anywhere in
your process via await streams.get_or_create(id) and program
against the <xref:EventStream> Protocol.
See docs/streaming-guide.md for the developer guide (registry
API, backings, per-turn id convention, exception/wire mapping,
third-party-impl peer-registry pattern).
Classes
| EventStream |
A multi-cast event stream. Four data-flow methods: emit, close,
subscribe, last_cursor. Lifecycle (create /
lookup / destroy) is the registry's job ( See |
| EventStreamClosedError |
Raised when The stream still exists; the caller cannot add more events. This is a server-side bug (the producer kept emitting after closing) and should be wire-mapped to 5xx, not 4xx. |
| EventStreamError |
Base class for all Lets callers |
| EventStreamNotFoundError |
Raised when any operation references a stream id that is not currently a live stream. unified the previously-distinct
Collapsing the two error types simplifies the developer-facing surface: either way, the right behavior is the same (subscribe to a new id, or treat this id as missing). It also stops leaking the registry's internal tombstone bookkeeping (whether an id was "previously alive" or "never seen") into the public API. Wire-mapped to HTTP 404 Not Found. |