JobQueue

JobQueue

JobQueue

Package: @vendure/core File: job-queue.ts

A JobQueue is used to process Jobs. A job is added to the queue via the .add() method, and the queue will then poll 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

class JobQueue<Data extends JobData<Data> = {}> {
  concurrency: number
  name: string
  started: boolean
  constructor(options: CreateQueueOptions<Data>, jobQueueStrategy: JobQueueStrategy, pollInterval: number)
  add(data: Data, options?: Pick<JobConfig<Data>, 'retries'>) => ;
}

Members

concurrency

property
type:
number

name

property
type:
string

started

property
type:
boolean

constructor

method
type:
(options: CreateQueueOptions<Data>, jobQueueStrategy: JobQueueStrategy, pollInterval: number) => JobQueue

add

method
type:
(data: Data, options?: Pick<JobConfig<Data>, 'retries'>) =>
Adds a new Job to the queue.

Contents: