queueRequired
TaskQueue
Queue the worker claims jobs from and reports results to.
workerRequired
string
Worker name recorded on each claimed job, 1 to 512 characters; give each process its own.
handlersRequired
Readonly<Record<string, QueueHandler>>
Handlers by name, 1 to 100; the worker claims only jobs whose handler is listed here.
signalRequired
AbortSignal
Stops the worker: runQueueWorker() resolves and the running handler’s signal aborts. That job stays active until its lease expires.
leaseMsOptional
number | undefined
Lease duration in milliseconds, default 30000, from 30 to 300000; renewed at every third of it.
pollMsOptional
number | undefined
Wait in milliseconds after finding no eligible job or before retrying a failed queue operation, default 250; must be positive.
onErrorOptional
((error: unknown) => void) | undefined
Receives claim, lease-renewal and result-publication errors. Throwing from this callback does not stop the worker; queue retries wait pollMs and remain cancellable.