In-memory message broker implementation.
Provides fanout delivery to subscribers without a queue, and load-balanced (round-robin) delivery to subscribers within a queue.
Creates a new in-memory broker.
serializer: ISerializer
Serializer for message payloads
options: InMemoryBrokerOptions
Optional behaviour, currently the dispatch-error reporter
connect(): Promise<void>
Connects the broker (idempotent no-op for in-memory).
disconnect(): Promise<void>
Disconnects the broker and clears all subscriptions.
isHealthy(): Promise<boolean>
Boolean port member (M70c).
isReady(): boolean
Checks if the broker is connected.
publish<T>(topic: string,message: T): Promise<void>
Publishes a message to a topic.
Delivers to all subscribers without a queue (fanout), and to one subscriber per queue (round-robin load balancing).
publishWithHeaders<T>(topic: string,message: T,headers: Readonly<Record<string, string>>): Promise<void>
Publishes a message with framework-owned transport headers. Resolves on
dispatch hand-off (see publish); each invoked handler's
promise is RETAINED and its rejection routed to the failure path below —
never dropped, never unhandled. @internal
reachability(): Promise<boolean>
Tri-state backend reachability (M70c).
There is no backend to be unreachable: the bus is in-process, so the
answer is simply whether the broker is running. true while ready,
false before connect() or after disconnect().
request<TReq, TRes>(): Promise<TRes>
Sends a request and awaits a single correlated reply.
requestWithHeaders<TReq, TRes>(): Promise<TRes>
Sends request-reply traffic with framework-owned headers. @internal
respond<TReq, TRes>(): Promise<ISubscription>
Registers a responder whose result is returned to the requesting caller.
subscribe<T>(): Promise<ISubscription>
Subscribes to a topic.
subscribeWithHeaders<T>(): Promise<ISubscription>
Subscribes through the header-aware internal path. @internal