Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QueueScheduler

This class is just used for some automatic bookkeeping of the queue, such as updating the delay set as well as moving stalled jobs back to the waiting list.

Jobs are checked for stallness once every "visibility window" seconds. Jobs are then marked as candidates for being stalled, in the next check, the candidates are marked as stalled and moved to wait. Workers need to clean the candidate list with the jobs that they are working on, failing to update the list results in the job ending being stalled.

This class requires a dedicated redis connection, and at least one is needed to be running at a given time, otherwise delays, stalled jobs, retries, repeatable jobs, etc, will not work correctly or at all.

Hierarchy

Index

Constructors

Properties

closing: Promise<void>
keys: KeysMap
name: string
toKey: (type: string) => string

Type declaration

    • (type: string): string
    • Parameters

      • type: string

      Returns string

Accessors

  • Returns a promise that resolves to a redis client. Normally used only by subclasses.

    Returns Promise<RedisClient>

  • get redisVersion(): string
  • Returns the version of the Redis instance the client is connected to,

    Returns string

Methods

  • close(): Promise<void>
  • disconnect(): Promise<void>
  • isRunning(): boolean
  • run(): Promise<void>
  • Run the scheduler.

    This method will run the scheduler in the background, and will not return until the scheduler is closed.

    If the QueueScheduler was instantiated with autorun: false, then it is not needed to manually call this method.

    Returns Promise<void>

Generated using TypeDoc