BullMQJobQueueStrategy

BullMQJobQueueStrategy

This JobQueueStrategy uses BullMQ to implement a push-based job queue on top of Redis. It should not be used alone, but as part of the BullMQJobQueuePlugin.

Signature

class BullMQJobQueueStrategy implements InspectableJobQueueStrategy {
  async init(injector: Injector) => Promise<void>;
  async destroy() => ;
  async add(job: Job<Data>) => Promise<Job<Data>>;
  async cancelJob(jobId: string) => Promise<Job | undefined>;
  async findMany(options?: JobListOptions) => Promise<PaginatedList<Job>>;
  async findManyById(ids: ID[]) => Promise<Job[]>;
  async findOne(id: ID) => Promise<Job | undefined>;
  async removeSettledJobs(queueNames?: string[], olderThan?: Date) => Promise<number>;
  async start(queueName: string, process: (job: Job<Data>) => Promise<any>) => Promise<void>;
  async stop(queueName: string, process: (job: Job<Data>) => Promise<any>) => Promise<void>;
}

Implements

Members

init

method
type:
(injector: Injector) => Promise<void>

destroy

method
type:
() =>

add

method
type:
(job: Job<Data>) => Promise<Job<Data>>

cancelJob

method
type:
(jobId: string) => Promise<Job | undefined>

findMany

method
type:
(options?: JobListOptions) => Promise<PaginatedList<Job>>

findManyById

method
type:
(ids: ID[]) => Promise<Job[]>

findOne

method
type:
(id: ID) => Promise<Job | undefined>

removeSettledJobs

method
type:
(queueNames?: string[], olderThan?: Date) => Promise<number>

start

method
type:
(queueName: string, process: (job: Job<Data>) => Promise<any>) => Promise<void>

stop

method
type:
(queueName: string, process: (job: Job<Data>) => Promise<any>) => Promise<void>