Skip to main content

Module eventbus

Module eventbus 

Source
Expand description

Event bus: WebSocket event dispatching to connected clients. Port of Go’s pkg/eventbus/eventbus.go.

Structs§

EventBus
Global event bus for dispatching WebSocket events to connected clients.
EventBusBridge
Bridge from MPS Broker to EventBus. Wraps MuxEvents as RPC eventrecv messages and broadcasts them to all WS clients.
WSEventType
WindowWatchData 🔒
WsReceivers
The pair of receivers handed to a WebSocket connection on registration. Terminal echo + interactive events arrive on priority; perf telemetry on background.

Enums§

Lane
Egress priority lane for a server→client event.

Constants§

BACKGROUND_LANE_CAPACITY 🔒
Background carries droppable perf telemetry (sysinfo ~1/s, per-block stats) already coalesced-to-latest by the receive loop — a healthy consumer never queues more than a couple of entries.
PRIORITY_LANE_CAPACITY 🔒
Egress channel capacities. Bounded (not unbounded) so a stalled/hidden- renderer WS consumer can’t grow sidecar commit without limit — a healthy connection drains far below these depths; hitting the cap is itself the signal that the consumer isn’t keeping up. See docs/specs/SPEC_MEMORY_COMMIT_ATTRIBUTION_CORRECTION_2026_07_02.md §B.2.
WS_EVENT_MUX_OBJ_BATCHED_UPDATES
One WS frame carrying an ARRAY of MuxObjUpdates from a single atomic backend transition. Mirrored in frontend/app/store/mps-events.ts (WpsEvent.MuxObjBatchedUpdates) — the frontend applies the whole array in one Solid batch() flush. See broadcast_mux_obj_updates below.
WS_EVENT_RPC

Functions§

rpc_eventrecv_value 🔒
The rpc/eventrecv WS envelope for event, built with a single serialization of the payload. See EventBusBridge::send_event.