bodhi-realtime-agent / EventBus
Class: EventBus
Defined in: core/event-bus.ts:25
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: core/event-bus.ts:58
Remove all handlers (used for cleanup in tests and session teardown).
Returns
void
Implementation of
publish()
publish<
T>(event,payload):void
Defined in: core/event-bus.ts:28
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: core/event-bus.ts:41
Register a handler for an event type. Returns an unsubscribe function.
Type Parameters
T
T extends keyof EventPayloadMap
Parameters
event
T
handler
EventHandler<T>