Skip to content

bodhi-realtime-agent / IEventBus

Interface: IEventBus

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

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

Methods

clear()

clear(): void

Defined in: core/event-bus.ts:18

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

Returns

void


publish()

publish<T>(event, payload): void

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

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: core/event-bus.ts:16

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