StreamMux(
self,
transformers: list[StreamTransformer] | None = None,
*,
is_async: | Name | Type | Description |
|---|---|---|
transformers | list[StreamTransformer] | None | Default: NoneAlready-built transformer instances. Registered
only on this mux — they are NOT cloned into child
mini-muxes built by |
is_async | bool | Default: FalseTrue for async dispatch ( |
factories | list[TransformerFactory] | None | Default: None |
scope | tuple[str, ...] | Default: () |
_assign_seq | bool | Default: True |
| Name | Type |
|---|---|
| transformers | list[StreamTransformer] | None |
| is_async | bool |
| factories | list[TransformerFactory] | None |
| scope | tuple[str, ...] |
| _assign_seq | bool |
Central event dispatcher for the streaming infrastructure.
Owns the main event log and routes events through a transformer
pipeline. StreamChannels with a name discovered in transformer
projections are auto-wired so that every push() also injects a
ProtocolEvent into the main log. StreamChannels without a name
are local-only.
Pass is_async=True when the mux will be consumed via async
iteration (handler.astream()). All StreamChannel instances
discovered during registration are automatically bound to the
matching mode.
One-argument callables (scope) -> StreamTransformer.
Called once with this mux's scope here, and cloned
again per child scope by _make_child so each
sub-mux gets fresh instances.
The namespace the mux operates within. The root mux
is ().
Internal flag for child muxes. Root muxes assign
monotonic seq numbers when appending to their main event
log; child muxes share forwarded event objects and must not
mutate their envelopes.