WorkerCluster
Defined in: src/worker/WorkerCluster.ts:61
Spawn a pool of workers and wire them into a shared broker via their
native postMessage channel. Each worker hosts its own ActorSystem +
Cluster; the broker routes BrokeredMessages between workers based on
the envelope’s to address.
The underlying Worker implementation is picked per runtime — Bun and
Deno use the Web Worker API, Node.js uses node:worker_threads — via
getWorkerBackend(). The cluster code itself never branches on
runtime; it only ever sees a runtime-neutral WorkerLike.
Properties
Section titled “Properties”broker
Section titled “broker”
readonlybroker:WorkerBroker
Defined in: src/worker/WorkerCluster.ts:62
Accessors
Section titled “Accessors”addresses
Section titled “addresses”Get Signature
Section titled “Get Signature”get addresses():
NodeAddress[]
Defined in: src/worker/WorkerCluster.ts:95
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get size():
number
Defined in: src/worker/WorkerCluster.ts:96
Returns
Section titled “Returns”number
Methods
Section titled “Methods”terminate()
Section titled “terminate()”terminate():
Promise<void>
Defined in: src/worker/WorkerCluster.ts:98
Returns
Section titled “Returns”Promise<void>
spawn()
Section titled “spawn()”
staticspawn(settings):Promise<WorkerCluster>
Defined in: src/worker/WorkerCluster.ts:87
Parameters
Section titled “Parameters”settings
Section titled “settings”Returns
Section titled “Returns”Promise<WorkerCluster>