import { InjectableStrategy } from '../../common'; import { JobData } 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. * * @docsCategory JobQueue */ export interface JobQueueStrategy extends InjectableStrategy { /** * @description * Add a new job to the queue. */ add = {}>(job: Job): Promise>; /** * @description * Start the job queue */ start = {}>(queueName: string, process: (job: Job) => Promise): Promise; /** * @description * Stops a queue from running. Its not guaranteed to stop immediately. */ stop = {}>(queueName: string, process: (job: Job) => Promise): Promise; }