WorkerCluster
Defined in: src/worker/WorkerCluster.ts:54
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(), unless the options name one explicitly. 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:55
Accessors
Section titled “Accessors”addresses
Section titled “addresses”Get Signature
Section titled “Get Signature”get addresses():
NodeAddress[]
Defined in: src/worker/WorkerCluster.ts:93
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get size():
number
Defined in: src/worker/WorkerCluster.ts:94
Returns
Section titled “Returns”number
Methods
Section titled “Methods”terminate()
Section titled “terminate()”terminate():
Promise<void>
Defined in: src/worker/WorkerCluster.ts:96
Returns
Section titled “Returns”Promise<void>
spawn()
Section titled “spawn()”
staticspawn(options):Promise<WorkerCluster>
Defined in: src/worker/WorkerCluster.ts:81
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<WorkerCluster>
