bullmq - v5.56.2
    Preparing search index...

    Class Worker<DataType, ResultType, NameType>

    This class represents a worker that is able to process jobs from the queue. As soon as the class is instantiated and a connection to Redis is established it will start processing jobs.

    Type Parameters

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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    closing: Promise<void>
    id: string
    keys: KeysMap
    name: string

    The name of the queue.

    Options for the queue.

    toKey: (type: string) => string

    Accessors

    • set concurrency(concurrency: number): void

      Parameters

      • concurrency: number

      Returns void

    • get redisVersion(): string

      Returns the version of the Redis instance the client is connected to,

      Returns string

    Methods

    • Closes the worker and related redis connections.

      This method waits for current jobs to finalize before returning.

      Parameters

      • force: boolean = false

        Use force boolean parameter if you do not want to wait for current jobs to be processed.

      Returns Promise<void>

      Promise that resolves when the worker has been closed.

    • This function is exposed only for testing purposes.

      Returns Promise<void>

    • Checks if worker is paused.

      Returns boolean

      true if worker is paused, false otherwise.

    • Checks if worker is currently running.

      Returns boolean

      true if worker is running, false otherwise.

    • Pauses the processing of this queue only for this worker.

      Parameters

      • OptionaldoNotWaitActive: boolean

      Returns Promise<void>

    • Resumes processing of this worker (if paused).

      Returns void