Skip to main content

JobQueue

A JobQueue is used to process Jobs. A job is added to the queue via the .add() method, and the configured JobQueueStrategy will check for new jobs and process each according to the defined process function.

Note: JobQueue instances should not be directly instantiated. Rather, the JobQueueService createQueue() method should be used (see that service for example usage).

Signature

name

propertystring

started

propertyboolean

constructor

method(options: CreateQueueOptions<Data>, jobQueueStrategy: JobQueueStrategy, jobBufferService: JobBufferService) => JobQueue

add

method(data: Data, options?: JobOptions<Data>) => Promise<SubscribableJob<Data>>

Adds a new Job to the queue. The resolved SubscribableJob allows the calling code to subscribe to updates to the Job:

Example

Ts

Alternatively, if you aren't interested in the intermediate progress changes, you can convert to a Promise like this:

Example

Ts
Was this chapter helpful?
Report Issue
Edited Feb 23, 2026ยทEdit this page