Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WorkerListener<DataType, ResultType, NameType>

Type parameters

  • DataType = any

  • ResultType = any

  • NameType: string = string

Hierarchy

Index

Methods

  • active(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
  • Listen to 'closing' event.

    This event is triggered when the worker is closed.

    Returns void

  • closing(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
  • 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
  • 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
  • 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
  • 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
  • paused(): 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
  • 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
  • Listen to 'resumed' event.

    This event is triggered when the queue is resumed.

    Returns void

Generated using TypeDoc