bodhi-realtime-agent / EventBus
Class: EventBus
Defined in: src/core/event-bus.ts:23
In-memory, synchronous event bus. Handler exceptions are caught and logged — they never propagate to the publisher.
Implements
Constructors
Constructor
new EventBus():
EventBus
Returns
EventBus
Methods
clear()
clear():
void
Defined in: src/core/event-bus.ts:56
Remove all handlers (used for cleanup in tests and session teardown).
Returns
void
Implementation of
publish()
publish<
T>(event,payload):void
Defined in: src/core/event-bus.ts:26
Synchronously dispatch an event to all registered handlers.
Type Parameters
T
T extends keyof EventPayloadMap
Parameters
event
T
payload
Returns
void
Implementation of
subscribe()
subscribe<
T>(event,handler):Unsubscribe
Defined in: src/core/event-bus.ts:39
Register a handler for an event type. Returns an unsubscribe function.
Type Parameters
T
T extends keyof EventPayloadMap
Parameters
event
T
handler
EventHandler<T>