Interface WorkerListener<DataType, ResultType, NameType>

Type Parameters

  • DataType = any

  • ResultType = any

  • NameType extends string = string

Hierarchy

Properties

active: ((job: Job<DataType, ResultType, NameType>, prev: string) => void)

Type declaration

    • (job: Job<DataType, ResultType, NameType>, prev: string): void
    • Listen to 'active' event.

      This event is triggered when a job enters the 'active' state.

      Parameters

      • job: Job<DataType, ResultType, NameType>
      • prev: string

      Returns void

closed: (() => void)

Type declaration

    • (): void
    • Listen to 'closing' event.

      This event is triggered when the worker is closed.

      Returns void

closing: ((msg: string) => void)

Type declaration

    • (msg: string): void
    • Listen to 'closing' event.

      This event is triggered when the worker is closing.

      Parameters

      • msg: string

      Returns void

completed: ((job: Job<DataType, ResultType, NameType>, result: ResultType, prev: string) => void)

Type declaration

    • (job: Job<DataType, ResultType, NameType>, result: ResultType, prev: string): void
    • Listen to 'completed' event.

      This event is triggered when a job has successfully completed.

      Parameters

      • job: Job<DataType, ResultType, NameType>
      • result: ResultType
      • prev: string

      Returns void

drained: (() => void)

Type declaration

    • (): void
    • Listen to 'drained' event.

      This event is triggered when the queue has drained the waiting list. Note that there could still be delayed jobs waiting their timers to expire and this event will still be triggered as long as the waiting list has emptied.

      Returns void

error: ((failedReason: Error) => void)

Type declaration

    • (failedReason: Error): void
    • Listen to 'error' event.

      This event is triggered when an error is throw.

      Parameters

      • failedReason: Error

      Returns void

failed: ((job: Job<DataType, ResultType, NameType>, error: Error, prev: string) => void)

Type declaration

    • (job: Job<DataType, ResultType, NameType>, error: Error, prev: string): void
    • Listen to 'failed' event.

      This event is triggered when a job has thrown an exception.

      Parameters

      • job: Job<DataType, ResultType, NameType>
      • error: Error
      • prev: string

      Returns void

ioredis:close: (() => void)

Type declaration

    • (): void
    • Listen to 'ioredis:close' event.

      This event is triggered when ioredis is closed.

      Returns void

paused: (() => void)

Type declaration

    • (): void
    • Listen to 'paused' event.

      This event is triggered when the queue is paused.

      Returns void

progress: ((job: Job<DataType, ResultType, NameType>, progress: number | object) => void)

Type declaration

    • (job: Job<DataType, ResultType, NameType>, progress: number | object): void
    • Listen to 'progress' event.

      This event is triggered when a job updates it progress, i.e. the Job##updateProgress() method is called. This is useful to notify progress or any other data from within a processor to the rest of the world.

      Parameters

      • job: Job<DataType, ResultType, NameType>
      • progress: number | object

      Returns void

resumed: (() => void)

Type declaration

    • (): void
    • Listen to 'resumed' event.

      This event is triggered when the queue is resumed.

      Returns void

stalled: ((jobId: string, prev: string) => void)

Type declaration

    • (jobId: string, prev: string): void
    • Listen to 'stalled' event.

      This event is triggered when a job has stalled and has been moved back to the wait list.

      Parameters

      • jobId: string
      • prev: string

      Returns void

Generated using TypeDoc