Expand description
Process-wide broadcast channel for the canonical log stream.
The gateway installs a [tokio::sync::broadcast::Sender<Value>] here at
startup; every event passing through crate::record_event is fanned
out to that channel so SSE clients (and any other in-process subscriber)
see the live stream.
Lives in this crate, not in zeroclaw-runtime, so the dependency graph stays clean: zeroclaw-api → zeroclaw-config → zeroclaw-log → everything else.
Functions§
- clear_
broadcast_ hook - Remove the broadcast sender (tests, orderly shutdown).
- current_
broadcast_ hook - Read the current broadcast sender, if any.
- set_
broadcast_ hook - Install a process-wide broadcast sender. Calling again replaces the
previous one (the old sender will be dropped — its
Receivers will seeRecvError::Closedon their next read). - subscribe
- Subscribe to the broadcast stream. Returns
Nonewhen no sender has been installed yet (e.g. when running tests that never wired the gateway). The receiver yields every event emitted viacrate::record_eventafter the subscribe call.
Type Aliases§
- LogBroadcast
Sender - Type alias for the canonical log broadcast sender.