Interface WorkerProListener<DataType, ResultType, NameType>

interface WorkerProListener<DataType, ResultType, NameType> {
    active: ((job, prev) => void);
    closed: (() => void);
    closing: ((msg) => void);
    completed: ((job, result, prev) => void);
    drained: (() => void);
    error: ((failedReason) => void);
    failed: ((job, error, prev) => void);
    paused: (() => void);
    progress: ((job, progress) => void);
    ready: (() => void);
    resumed: (() => void);
    stalled: ((jobId, prev) => void);
}

Type Parameters

  • DataType = any
  • ResultType = any
  • NameType extends string = string

Hierarchy

  • IoredisListener
    • WorkerProListener

Properties

active: ((job, prev) => void)

Listen to 'active' event.

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

Type declaration

closed: (() => void)

Listen to 'closing' event.

This event is triggered when the worker is closed.

Type declaration

    • (): void
    • Returns void

closing: ((msg) => void)

Listen to 'closing' event.

This event is triggered when the worker is closing.

Type declaration

    • (msg): void
    • Parameters

      • msg: string

      Returns void

completed: ((job, result, prev) => void)

Listen to 'completed' event.

This event is triggered when a job has successfully completed.

Type declaration

drained: (() => 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.

Type declaration

    • (): void
    • Returns void

error: ((failedReason) => void)

Listen to 'error' event.

This event is triggered when an error is throw.

Type declaration

    • (failedReason): void
    • Parameters

      • failedReason: Error

      Returns void

failed: ((job, error, prev) => void)

Listen to 'failed' event.

This event is triggered when a job has thrown an exception. Note: job parameter could be received as undefined when an stalled job reaches the stalled limit and it is deleted by the removeOnFail option.

Type declaration

paused: (() => void)

Listen to 'paused' event.

This event is triggered when the queue is paused.

Type declaration

    • (): void
    • Returns void

progress: ((job, progress) => 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.

Type declaration

ready: (() => void)

Listen to 'ready' event.

This event is triggered when blockingConnection is ready.

Type declaration

    • (): void
    • Returns void

resumed: (() => void)

Listen to 'resumed' event.

This event is triggered when the queue is resumed.

Type declaration

    • (): void
    • Returns void

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

Listen to 'stalled' event.

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

Type declaration

    • (jobId, prev): void
    • Parameters

      • jobId: string
      • prev: string

      Returns void