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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WorkerBroker():
WorkerBroker
Returns
Section titled “Returns”WorkerBroker
Methods
Section titled “Methods”close()
Section titled “close()”close():
void
Defined in: src/worker/WorkerBroker.ts:44
Close every port; further messages are dropped.
Returns
Section titled “Returns”void
register()
Section titled “register()”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.
Parameters
Section titled “Parameters”address
Section titled “address”Returns
Section titled “Returns”void
registered()
Section titled “registered()”registered():
NodeAddress[]
Defined in: src/worker/WorkerBroker.ts:54
Snapshot of currently-registered addresses — diagnostic only.
Returns
Section titled “Returns”unregister()
Section titled “unregister()”unregister(
address):void
Defined in: src/worker/WorkerBroker.ts:34
Drop a worker’s port (typically on worker shutdown).
Parameters
Section titled “Parameters”address
Section titled “address”Returns
Section titled “Returns”void