EventBus
EventBus:
object
Defined in: Core/EventBus.ts:38
Type Declaration
Section titled “Type Declaration”emit:
object=emitEventBus
Emits a message payload to one or more target event buses.
Uses a synchronous breadth-first trampoline queue to handle re-entrant emissions deterministically.
- EventBus.subscribe for subscribing to emitted messages.
- EventBus.forward for routing messages between event buses.
Example
Section titled “Example”forward
Section titled “forward”forward:
object=forwardEventBus
Forwards messages from one event bus to another (or multiple).
- EventBus.emit for publishing messages directly.
- EventBus.subscribe for consuming events on a bus.
Example
Section titled “Example”make:
object=makeEventBus
Constructs a new EventBus instance.
- EventBus.emit for dispatching messages to an event bus.
- EventBus.subscribe for registering subscribers or sequence matchers.
Example
Section titled “Example”subscribe
Section titled “subscribe”subscribe:
object=subscribeEventBus
Initiates subscriber registration on an event bus for all events, specific event kind(s), or sequence.
When called with only an event bus (EventBus.subscribe(bus)), observes every event defined on the bus schema.
When called with event kinds, observes only matching events or sequences.
- EventBus.emit for dispatching messages to subscribers.
- EventBus.forward for bridging events across buses.