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).
name
property
stringstarted
property
booleanconstructor
method
(options: CreateQueueOptions<Data>, jobQueueStrategy: JobQueueStrategy, jobBufferService: JobBufferService) => JobQueueadd
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
Alternatively, if you aren't interested in the intermediate
progress changes, you can convert to a Promise like this:
Example
Was this chapter helpful?