Types

types

CreateQueueOptions

Package: @vendure/core File: types.ts

Used to configure a new JobQueue instance.

Signature

interface CreateQueueOptions<T extends JobData<T>> {
  name: string;
  concurrency: number;
  process: (job: Job<T>) => any | Promise<any>;
}

Members

name

property
type:
string
The name of the queue, e.g. “image processing”, “re-indexing” etc.

concurrency

property
type:
number
How many jobs of this type may be run concurrently.

process

property
type:
(job: Job<T>) => any | Promise<any>
Defines the work to be done for each job in the queue. When the work is complete, job.complete() should be called, and for any errors, job.fail() should be called. Unhandled exceptions will automatically call job.fail().

JobData

Package: @vendure/core File: types.ts

A JSON-serializable data type which provides a Job with the data it needs to be processed.

Signature

type JobData<T> = JsonCompatible<T>

JobConfig

Package: @vendure/core File: types.ts

Used to instantiate a new Job

Signature

interface JobConfig<T extends JobData<T>> {
  queueName: string;
  data: T;
  retries?: number;
  attempts?: number;
  id?: ID;
  state?: JobState;
  progress?: number;
  result?: any;
  error?: any;
  createdAt?: Date;
  startedAt?: Date;
  settledAt?: Date;
}

Members

queueName

property
type:
string

data

property
type:
T

retries

property
type:
number

attempts

property
type:
number

id

property
type:
ID

state

property
type:
JobState

progress

property
type:
number

result

property
type:
any

error

property
type:
any

createdAt

property
type:
Date

startedAt

property
type:
Date

settledAt

property
type:
Date