Interface QueueEventsListener

Hierarchy

Properties

active: ((args: { jobId: string; prev?: string }, id: string) => void)

Type declaration

    • (args: { jobId: string; prev?: string }, id: string): 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: { jobId: string; name: string }, id: string) => void)

Type declaration

    • (args: { jobId: string; name: string }, id: string): 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: { count: string }, id: string) => void)

Type declaration

    • (args: { count: string }, id: string): 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: { jobId: string; prev?: string; returnvalue: string }, id: string) => void)

Type declaration

    • (args: { jobId: string; prev?: string; returnvalue: string }, id: string): 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

delayed: ((args: { delay: number; jobId: string }, id: string) => void)

Type declaration

    • (args: { delay: number; jobId: string }, id: string): 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: string) => void)

Type declaration

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

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

Type declaration

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

      This event is triggered when an exception is thrown.

      Parameters

      • args: Error

      Returns void

failed: ((args: { failedReason: string; jobId: string; prev?: string }, id: string) => void)

Type declaration

    • (args: { failedReason: string; jobId: string; prev?: string }, id: string): 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)

Type declaration

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

      This event is triggered when ioredis is closed.

      Returns void

paused: ((args: {}, id: string) => void)

Type declaration

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

      This event is triggered when a queue is paused.

      Parameters

      • args: {}
        • id: string

        Returns void

    progress: ((args: { data: number | object; jobId: string }, id: string) => void)

    Type declaration

      • (args: { data: number | object; jobId: string }, id: string): 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: { jobId: string; prev: string }, id: string) => void)

    Type declaration

      • (args: { jobId: string; prev: string }, id: string): 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: string) => void)

    Type declaration

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

        This event is triggered when a queue is resumed.

        Parameters

        • args: {}
          • id: string

          Returns void

      retries-exhausted: ((args: { attemptsMade: string; jobId: string }, id: string) => void)

      Type declaration

        • (args: { attemptsMade: string; jobId: string }, id: string): 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: { jobId: string }, id: string) => void)

      Type declaration

        • (args: { jobId: string }, id: string): 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: { jobId: string; prev?: string }, id: string) => void)

      Type declaration

        • (args: { jobId: string; prev?: string }, id: string): 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: { jobId: string }, id: string) => void)

      Type declaration

        • (args: { jobId: string }, id: string): 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