interface ProcessOptions
Since 0.1.0

Options accepted when registering a processor.

Properties

readonly
optional
concurrency: number

Jobs processed concurrently by this worker (default 1).

Since 0.3.0
readonly
optional
onFailed: (
job: IJob,
error: unknown
) => void | Promise<void>

Invoked once when a job has exhausted its attempts, immediately before it is dead-lettered — the only programmatic notice that work was permanently abandoned. It does NOT fire on an attempt that will be retried.

Without it a dead-lettered job is reachable only by opening a Redis client: IQueue has no getJob and no dead-letter accessor, and the adapters' dead-letter structures are internal.

A callback that throws is reported through the application's logger and swallowed; the dead-letter still happens, because losing the job as well as the notification would be strictly worse than losing the notification.

Usage

import { type ProcessOptions } from "queue-plugin/src/index.ts";