Skip to content

JobQueue

Jobs extends object = JobMap

new JobQueue<Jobs>(definition, bull, deps): JobQueue<Jobs>

QueueDefinition<Jobs>

Queue

The underlying BullMQ queue, for reads this class does not wrap (counts, getJob).

JobQueueDeps

JobQueue<Jobs>

readonly bull: Queue

The underlying BullMQ queue, for reads this class does not wrap (counts, getJob).


readonly definition: QueueDefinition<Jobs>


readonly pause: QueuePause

The one pause of this queue; see QueuePause.

get name(): string

string

add<Name>(name, data, options): Promise<AddResult>

Enqueues one job. Rejects at once while Redis is unreachable.

Name extends string

Name

Jobs[Name]

AddOptions

Promise<AddResult>


pauseFor(ms): Promise<number>

Stops the queue from handing out jobs for at least ms; see QueuePause.

number

Promise<number>


releaseDedupe(key): Promise<boolean>

Ends a dedupe window early, so the next add() with this key enqueues. For a deliberate restart (an admin re-sending a failed announcement). Resolves to whether a window was open.

DedupeKey

Promise<boolean>