import { InjectableStrategy } from '../../common'; import { JobData, JobQueueStrategyJobOptions } from '../../job-queue'; import { Job } from '../../job-queue'; /** * @description * Defines how the jobs in the {@link JobQueueService} are persisted and * accessed. Custom strategies can be defined to make use of external * services such as Redis. * * :::info * * This is configured via the `jobQueueOptions.jobQueueStrategy` property of * your VendureConfig. * * ::: * * @docsCategory JobQueue */ export interface JobQueueStrategy extends InjectableStrategy { /** * @description * Add a new job to the queue. */ add = object>(job: Job, jobOptions?: JobQueueStrategyJobOptions): Promise>; /** * @description * Start the job queue */ start = object>(queueName: string, process: (job: Job) => Promise): Promise; /** * @description * Stops a queue from running. Its not guaranteed to stop immediately. */ stop = object>(queueName: string, process: (job: Job) => Promise): Promise; }