import { JobListOptions } from '@vendure/common/lib/generated-types'; import { ID, Injector, InspectableJobQueueStrategy, Job, JobData, PaginatedList } from '@vendure/core'; /** * @description * This JobQueueStrategy uses [BullMQ](https://docs.bullmq.io/) to implement a push-based job queue * on top of Redis. It should not be used alone, but as part of the {@link BullMQJobQueuePlugin}. * * Note: To use this strategy, you need to manually install the `bullmq` package: * * ```shell * npm install bullmq@^5.4.2 * ``` * * @docsCategory core plugins/JobQueuePlugin */ export declare class BullMQJobQueueStrategy implements InspectableJobQueueStrategy { private redisConnection; private connectionOptions; private queue; /** * Workers are grouped by their concurrency value. * Key: concurrency number, Value: Worker instance. * Multiple Vendure queues with the same concurrency share a single worker. */ private workers; private workerProcessor; private options; private jobListIndexService; private readonly queueNameProcessFnMap; private cancellationSub; private cancellationSubscribed; private readonly cancelRunningJob$; private readonly CANCEL_JOB_CHANNEL; private readonly CANCELLED_JOB_LIST_NAME; init(injector: Injector): Promise; destroy(): Promise; add = object>(job: Job): Promise>; cancelJob(jobId: string): Promise; /** * Maps a Vendure JobState to the BullMQ job types which hold jobs in that state. * Jobs awaiting a retry after failure are stored in the 'delayed' state, and * cancelled jobs are stored as 'failed'. */ private jobStateToJobTypes; findMany(options?: JobListOptions): Promise>; findManyById(ids: ID[]): Promise; findOne(id: ID): Promise; removeSettledJobs(queueNames?: string[], olderThan?: Date): Promise; start = object>(queueName: string, process: (job: Job) => Promise): Promise; private readonly subscribeToCancellationEvents; private stopped; stop = object>(queueName: string, process: (job: Job) => Promise): Promise; private setActiveJobAsCancelled; private createVendureJob; private getState; private callCustomScript; private defineCustomLuaScripts; }