Module broadcast
Expand description
The process-wide observability event bus.
BroadcastObserver turns ObserverEvents into the JSON frames that
/api/events (SSE) and RPC logs/subscribe deliver, and keeps the most
recent ones in an EventBuffer for history replay (/api/events/history,
RPC events/history). EventBus bundles the live sender with that
buffer. The daemon owns one bus and installs its observer as the global
broadcast hook exactly once, so agent, tool, and LLM frames reach RPC
subscribers whether or not the gateway runs; a standalone gateway builds
and installs its own.
Structs§
- Broadcast
Observer - Event
Buffer - Thread-safe ring buffer that retains recent events for history replay.
- Event
Bus - The live event sender plus its history buffer.
Constants§
- EVENT_
CHANNEL_ CAPACITY - Frames the live broadcast channel holds for slow subscribers.
- EVENT_
HISTORY_ CAPACITY - Frames retained for history replay.
Functions§
- history_
events - Buffered frames that may be replayed, oldest first.
- is_
public_ event - Whether a frame may be delivered on a public, non-session stream: every
observer frame (tagged
source = "observability"), plus any frame that is not scoped to a session.