Ir al contenido
Español

WorkerCluster

Esta página aún no está disponible en tu idioma.

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.

readonly broker: WorkerBroker

Defined in: src/worker/WorkerCluster.ts:55

get addresses(): NodeAddress[]

Defined in: src/worker/WorkerCluster.ts:93

NodeAddress[]


get size(): number

Defined in: src/worker/WorkerCluster.ts:94

number

terminate(): Promise<void>

Defined in: src/worker/WorkerCluster.ts:96

Promise<void>


static spawn(options): Promise<WorkerCluster>

Defined in: src/worker/WorkerCluster.ts:81

WorkerClusterOptions

Promise<WorkerCluster>