Interface QueueEventsListener

interface QueueEventsListener {
    active: ((args, id) => void);
    added: ((args, id) => void);
    cleaned: ((args, id) => void);
    completed: ((args, id) => void);
    debounced: ((args, id) => void);
    deduplicated: ((args, id) => void);
    delayed: ((args, id) => void);
    drained: ((id) => void);
    duplicated: ((args, id) => void);
    error: ((args) => void);
    failed: ((args, id) => void);
    ioredis:close: (() => void);
    paused: ((args, id) => void);
    progress: ((args, id) => void);
    removed: ((args, id) => void);
    resumed: ((args, id) => void);
    retries-exhausted: ((args, id) => void);
    stalled: ((args, id) => void);
    waiting: ((args, id) => void);
    waiting-children: ((args, id) => void);
}

Hierarchy (view full)

Properties

active: ((args, id) => void)

Listen to 'active' event.

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

Type declaration

    • (args, id): void
    • Listen to 'active' event.

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

      Parameters

      • args: {
            jobId: string;
            prev?: string;
        }
        • jobId: string
        • Optional prev?: string
      • id: string

      Returns void

added: ((args, id) => void)

Listen to 'added' event.

This event is triggered when a job is created.

Type declaration

    • (args, id): void
    • Listen to 'added' event.

      This event is triggered when a job is created.

      Parameters

      • args: {
            jobId: string;
            name: string;
        }
        • jobId: string
        • name: string
      • id: string

      Returns void

cleaned: ((args, id) => void)

Listen to 'cleaned' event.

This event is triggered when a cleaned method is triggered.

Type declaration

    • (args, id): void
    • Listen to 'cleaned' event.

      This event is triggered when a cleaned method is triggered.

      Parameters

      • args: {
            count: string;
        }
        • count: string
      • id: string

      Returns void

completed: ((args, id) => void)

Listen to 'completed' event.

This event is triggered when a job has successfully completed.

Type declaration

    • (args, id): void
    • Listen to 'completed' event.

      This event is triggered when a job has successfully completed.

      Parameters

      • args: {
            jobId: string;
            prev?: string;
            returnvalue: string;
        }
        • jobId: string
        • Optional prev?: string
        • returnvalue: string
      • id: string

      Returns void

debounced: ((args, id) => void)

Listen to 'debounced' event.

Type declaration

    • (args, id): void
    • Listen to 'debounced' event.

      Parameters

      • args: {
            debounceId: string;
            jobId: string;
        }
        • debounceId: string
        • jobId: string
      • id: string

      Returns void

      Deprecated

      use deduplicated event

      This event is triggered when a job is debounced because debounceId still existed.

Deprecated

use deduplicated event

This event is triggered when a job is debounced because debounceId still existed.

deduplicated: ((args, id) => void)

Listen to 'deduplicated' event.

This event is triggered when a job is deduplicated because deduplicatedId still existed.

Type declaration

    • (args, id): void
    • Listen to 'deduplicated' event.

      This event is triggered when a job is deduplicated because deduplicatedId still existed.

      Parameters

      • args: {
            deduplicationId: string;
            jobId: string;
        }
        • deduplicationId: string
        • jobId: string
      • id: string

      Returns void

delayed: ((args, id) => void)

Listen to 'delayed' event.

This event is triggered when a job is delayed.

Type declaration

    • (args, id): void
    • Listen to 'delayed' event.

      This event is triggered when a job is delayed.

      Parameters

      • args: {
            delay: number;
            jobId: string;
        }
        • delay: number
        • jobId: string
      • id: string

      Returns void

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

    • (id): 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.

      Parameters

      • id: string

      Returns void

duplicated: ((args, id) => void)

Listen to 'duplicated' event.

This event is triggered when a job is not created because it already exist.

Type declaration

    • (args, id): void
    • Listen to 'duplicated' event.

      This event is triggered when a job is not created because it already exist.

      Parameters

      • args: {
            jobId: string;
        }
        • jobId: string
      • id: string

      Returns void

error: ((args) => void)

Listen to 'error' event.

This event is triggered when an exception is thrown.

Type declaration

    • (args): void
    • Listen to 'error' event.

      This event is triggered when an exception is thrown.

      Parameters

      • args: Error

      Returns void

failed: ((args, id) => void)

Listen to 'failed' event.

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

Type declaration

    • (args, id): void
    • Listen to 'failed' event.

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

      Parameters

      • args: {
            failedReason: string;
            jobId: string;
            prev?: string;
        }
        • failedReason: string
        • jobId: string
        • Optional prev?: string
      • id: string

      Returns void

ioredis:close: (() => void)

Listen to 'ioredis:close' event.

This event is triggered when ioredis is closed.

Type declaration

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

      This event is triggered when ioredis is closed.

      Returns void

paused: ((args, id) => void)

Listen to 'paused' event.

This event is triggered when a queue is paused.

Type declaration

    • (args, id): void
    • Listen to 'paused' event.

      This event is triggered when a queue is paused.

      Parameters

      • args: {}
        • id: string

        Returns void

    progress: ((args, id) => 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

      • (args, id): 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

        • args: {
              data: number | object;
              jobId: string;
          }
          • data: number | object
          • jobId: string
        • id: string

        Returns void

    removed: ((args, id) => void)

    Listen to 'removed' event.

    This event is triggered when a job has been manually removed from the queue.

    Type declaration

      • (args, id): void
      • Listen to 'removed' event.

        This event is triggered when a job has been manually removed from the queue.

        Parameters

        • args: {
              jobId: string;
              prev: string;
          }
          • jobId: string
          • prev: string
        • id: string

        Returns void

    resumed: ((args, id) => void)

    Listen to 'resumed' event.

    This event is triggered when a queue is resumed.

    Type declaration

      • (args, id): void
      • Listen to 'resumed' event.

        This event is triggered when a queue is resumed.

        Parameters

        • args: {}
          • id: string

          Returns void

      retries-exhausted: ((args, id) => void)

      Listen to 'retries-exhausted' event.

      This event is triggered when a job has retried the maximum attempts.

      Type declaration

        • (args, id): void
        • Listen to 'retries-exhausted' event.

          This event is triggered when a job has retried the maximum attempts.

          Parameters

          • args: {
                attemptsMade: string;
                jobId: string;
            }
            • attemptsMade: string
            • jobId: string
          • id: string

          Returns void

      stalled: ((args, id) => void)

      Listen to 'stalled' event.

      This event is triggered when a job has been moved from 'active' back to 'waiting'/'failed' due to the processor not being able to renew the lock on the said job.

      Type declaration

        • (args, id): void
        • Listen to 'stalled' event.

          This event is triggered when a job has been moved from 'active' back to 'waiting'/'failed' due to the processor not being able to renew the lock on the said job.

          Parameters

          • args: {
                jobId: string;
            }
            • jobId: string
          • id: string

          Returns void

      waiting: ((args, id) => void)

      Listen to 'waiting' event.

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

      Type declaration

        • (args, id): void
        • Listen to 'waiting' event.

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

          Parameters

          • args: {
                jobId: string;
                prev?: string;
            }
            • jobId: string
            • Optional prev?: string
          • id: string

          Returns void

      waiting-children: ((args, id) => void)

      Listen to 'waiting-children' event.

      This event is triggered when a job enters the 'waiting-children' state.

      Type declaration

        • (args, id): void
        • Listen to 'waiting-children' event.

          This event is triggered when a job enters the 'waiting-children' state.

          Parameters

          • args: {
                jobId: string;
            }
            • jobId: string
          • id: string

          Returns void

      Generated using TypeDoc