Skip to content

bodhi-realtime-agent / IEventBus

Interface: IEventBus ​

Defined in: src/core/event-bus.ts:10

Type-safe event bus interface. All framework components communicate via this bus for loose coupling.

Methods ​

clear() ​

clear(): void

Defined in: src/core/event-bus.ts:16

Remove all handlers (used for cleanup in tests and session teardown).

Returns ​

void


publish() ​

publish<T>(event, payload): void

Defined in: src/core/event-bus.ts:12

Synchronously dispatch an event to all registered handlers.

Type Parameters ​

T ​

T extends keyof EventPayloadMap

Parameters ​

event ​

T

payload ​

EventPayloadMap[T]

Returns ​

void


subscribe() ​

subscribe<T>(event, handler): Unsubscribe

Defined in: src/core/event-bus.ts:14

Register a handler for an event type. Returns an unsubscribe function.

Type Parameters ​

T ​

T extends keyof EventPayloadMap

Parameters ​

event ​

T

handler ​

EventHandler<T>

Returns ​

Unsubscribe

Built with VitePress