JobQueueOptions.safe property
Whether a job is handed to a worker under a lock, so that a worker dying before it starts does not take the job with it.
Signature:
safe?: boolean;
Default Value
true
Remarks
When safe delivery is enabled a job is moved atomically out of the queue into a worker-owned key as it is popped, so a process that dies before it even starts on that job leaves the job data behind to be re-queued for another worker instead of losing it.
The guarantee covers that hand-off and not the processing: the key is released as soon as the job reaches the handler, so a worker killed part-way through onPop loses that attempt. Jobs are delivered at-least-once, so handlers should be idempotent.
Note this defaults to true here while @imqueue/core defaults it to false — a job queue is the case where the extra round-trip is worth it.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.