Documentation / zerotal / queue / WorkerPoolOptions
Interface: WorkerPoolOptions
Defined in: packages/queue/src/WorkerPool.ts:4
Properties
size
size:
number
Defined in: packages/queue/src/WorkerPool.ts:6
Number of OS threads to spawn.
bootstrapPath?
optionalbootstrapPath?:string
Defined in: packages/queue/src/WorkerPool.ts:12
Optional absolute path or file URL to a module that imports+registers all job
classes. When omitted, the worker thread discovers jobs by convention (imports
every app/jobs/*.ts). Set it only to override that with an explicit bootstrap.
maxPending?
optionalmaxPending?:number
Defined in: packages/queue/src/WorkerPool.ts:22
Most jobs allowed to wait in memory for a free thread. Default: size * 64.
A job sitting in this backlog is already claimed — the driver has reserved it and is
counting down its visibility timeout. Queue more than the pool can work through and
those jobs are reclaimed and executed a second time while the first copy is still
waiting its turn. Past the cap, run() reports failure immediately so the job goes
back to the driver instead of aging out.
maxRespawns?
optionalmaxRespawns?:number
Defined in: packages/queue/src/WorkerPool.ts:27
How many times a slot may respawn after its worker dies before the pool gives up on it. Default: 5. A worker whose script throws on load would otherwise respawn forever.