Skip to content

basalt / queue-bullmq/src / BullmqQueueDriver

Class: BullmqQueueDriver ​

Defined in: queue-bullmq/src/index.ts:57

Queue driver contract. BullMQ in production; sync in tests/dev.

Implements ​

Constructors ​

Constructor ​

> new BullmqQueueDriver(options): BullmqQueueDriver

Defined in: queue-bullmq/src/index.ts:68

Parameters ​

options ​

BullmqDriverOptions

Returns ​

BullmqQueueDriver

Properties ​

capabilities ​

> readonly capabilities: object

Defined in: queue-bullmq/src/index.ts:59

What this backend honors — see DriverCapabilities.

backoff ​

> backoff: boolean = true

delayed ​

> delayed: boolean = true

priority ​

> priority: boolean = true

retries ​

> retries: boolean = true

Implementation of ​

QueueDriver.capabilities


name ​

> readonly name: "bullmq" = 'bullmq'

Defined in: queue-bullmq/src/index.ts:58

Short identifier used in diagnostics (e.g. 'bullmq', 'sync').

Implementation of ​

QueueDriver.name

Methods ​

add() ​

> add(queue, jobName, data, options): Promise<void>

Defined in: queue-bullmq/src/index.ts:89

Parameters ​

queue ​

string

jobName ​

string

data ​

unknown

options ​

AddJobOptions

Returns ​

Promise<void>

Implementation of ​

QueueDriver.add


close() ​

> close(): Promise<void>

Defined in: queue-bullmq/src/index.ts:180

Returns ​

Promise<void>

Implementation of ​

QueueDriver.close


list() ​

> list(queue, options?): Promise<JobSummary[]>

Defined in: queue-bullmq/src/index.ts:163

Reads jobs WITHOUT consuming them — Redis keeps finished jobs (subject to retention), so inspection here is non-destructive, which is why BullMQ can offer list at all.

One getJobs per state, each capped at limit: that keeps every job's state known without an extra job.getState() round-trip per job, and stops one busy state (usually completed) from starving the others. The merged result is sorted newest-first and truncated to limit.

Parameters ​

queue ​

string

options? ​

ListJobsOptions = {}

Returns ​

Promise<JobSummary[]>

Implementation of ​

QueueDriver.list


retryFailed() ​

> retryFailed(queue, options?): Promise<number>

Defined in: queue-bullmq/src/index.ts:138

Optional: re-enqueue failed jobs (basalt queue:retry). Returns how many were retried. limit caps how many are processed (default driver's choice).

Parameters ​

queue ​

string

options? ​
limit? ​

number

Returns ​

Promise<number>

Implementation of ​

QueueDriver.retryFailed


setExecutor() ​

> setExecutor(executor): void

Defined in: queue-bullmq/src/index.ts:85

Called once by the QueueManager — how to execute a received job.

Parameters ​

executor ​

JobExecutor

Returns ​

void

Implementation of ​

QueueDriver.setExecutor


startWorker() ​

> startWorker(queue, options?): void

Defined in: queue-bullmq/src/index.ts:104

Starts a worker for the queue (no-op in the sync driver: add executes inline).

Parameters ​

queue ​

string

options? ​
concurrency? ​

number

Returns ​

void

Implementation of ​

QueueDriver.startWorker


stats() ​

> stats(queue): Promise<QueueStats>

Defined in: queue-bullmq/src/index.ts:127

Optional: job counts per state, for basalt queue:stats. Backends that cannot introspect (e.g. the inline sync driver) omit it — the CLI then reports the operation as unsupported rather than guessing.

Parameters ​

queue ​

string

Returns ​

Promise<QueueStats>

Implementation of ​

QueueDriver.stats

Released under the MIT License.