Skip to content

WorkerBroker

Defined in: src/worker/WorkerBroker.ts:17

Main-thread piece of the multi-core cluster. Collects one MessagePort per worker and forwards BrokeredMessages based on their to address. Unknown destinations are dropped silently — the rest of the cluster deals with them through the normal dead-letters / failure-detection paths.

The broker itself does not speak the cluster gossip protocol; it is purely a routing layer between worker transports.

new WorkerBroker(): WorkerBroker

WorkerBroker

close(): void

Defined in: src/worker/WorkerBroker.ts:44

Close every port; further messages are dropped.

void


register(address, port): void

Defined in: src/worker/WorkerBroker.ts:25

Register a worker’s port — the broker will forward to its peers from now on and accept inbound traffic from it.

NodeAddress

PortLike

void


registered(): NodeAddress[]

Defined in: src/worker/WorkerBroker.ts:54

Snapshot of currently-registered addresses — diagnostic only.

NodeAddress[]


unregister(address): void

Defined in: src/worker/WorkerBroker.ts:34

Drop a worker’s port (typically on worker shutdown).

NodeAddress

void