Skip to main content
Version: Current

Broker

@rotorsoft/act-root


@rotorsoft/act-root / act-notify / Broker

Type Alias: Broker

Broker = object

Defined in: libs/act-notify/src/with-broker.ts:43

Minimal broker contract — publish one message to every subscriber on the channel (fan-out semantics; a queue that delivers to one consumer starves every other worker's wakeup).

Methods​

publish()​

publish(message): void | Promise<void>

Defined in: libs/act-notify/src/with-broker.ts:44

Parameters​

message​

BrokerMessage

Returns​

void | Promise<void>


subscribe()​

subscribe(handler): BrokerDisposer | Promise<BrokerDisposer>

Defined in: libs/act-notify/src/with-broker.ts:45

Parameters​

handler​

(message) => void

Returns​

BrokerDisposer | Promise<BrokerDisposer>