import { Job } from 'kue-unique'; import KueScheduler from 'kue-scheduler'; import { ProducerJob, JobMakerInterface } from '@ioc:Adonis5/Queue'; /** * Parse producer job contents and generate kue job * * @version 2.0.0 * @adonis-version 4.0+ */ export default class JobMaker implements JobMakerInterface { job: ProducerJob; kueJob: Job; queue: KueScheduler; /** * Get the final made job * @return {Kue/Job} */ getFinalJob(): Job; /** * Inject the app job * @param {App/Job} job */ setAppJob(job: any): this; /** * Inject the Kue queue * @param {Queue} queue */ setQueue(queue: any): this; /** * Run through the making procedures * @return {this} */ process(): this; /** * Initalize the Kue Job * @param {App/Job} job * @return {this} */ initialize(): this; /** * Set priority for the job * @return {this} */ assignPriority(): this; /** * Set failure attempts for the job * @return {this} */ assignFailureAttempts(): this; /** * Set failure backoff for the job * @return {this} */ assignFailureBackoff(): this; /** * Set job delay * @return {this} */ assignDelay(): this; /** * Set Time to live for the job * @return {this} */ assignTTL(): this; /** * Set uniqueness of this job * @return {this} */ assignUnique(): this; /** * Assign event listeners for the job * @return {this} */ assignEventListeners(): this; }