Class JobPro<DataType, ReturnType, NameType>

Type Parameters

  • DataType = any
  • ReturnType = any
  • NameType extends string = string

Hierarchy (view full)

  • Job<DataType, ReturnType, NameType>
    • JobPro

Constructors

  • Parameters

    • queue: MinimalQueue
    • name: NameType

      The name of the Job

    • data: DataType

      The payload for this job.

    • opts: JobsProOptions = {}

      The options object for this job.

    • Optional id: string

    Returns JobPro<DataType, ReturnType, NameType>

Methods

  • Moves a job to the completed queue. Returned job to be used with Queue.prototype.nextJobFromJobData.

    Parameters

    • returnValue: ReturnType

      The jobs success message.

    • token: string

      Worker token used to acquire completed job.

    • fetchNext: boolean = true

      True when wanting to fetch the next job.

    Returns Promise<JobData | []>

    Returns the jobData of the next job in the waiting queue.

  • Moves a job to the failed queue.

    Parameters

    • err: Error

      the jobs error message.

    • token: string

      token to check job is locked by current worker

    • fetchNext: boolean = false

      true when wanting to fetch the next job

    Returns Promise<void>

    void