Stone.js API
    Preparing search index...

    Multi-connection queue registry.

    Application code resolves a connection by name (queueManager.connection('redis')) and talks to it through the agnostic QueueConnection contract. A process-wide default instance lets the dispatch() helper and the worker reach it without wiring.

    Index
    • Parameters

      • defaultConnection: string = 'memory'

        The default connection name.

      Returns QueueManager

    • Resolve a connection by name (defaults to the default connection).

      Parameters

      • Optionalname: string

        The connection name.

      Returns QueueConnection

      The resolved QueueConnection.

      When no connection/factory is registered under the name.

    • Dispatch a job on the default connection.

      Type Parameters

      • T = unknown

      Parameters

      • name: string

        The job name.

      • payload: T

        The job payload.

      • Optionaloptions: JobOptions

        Dispatch options.

      Returns Promise<string>

      The job id.

    • Whether a connection (instance or factory) is registered under the name.

      Parameters

      • name: string

        The connection name.

      Returns boolean

      True if registered.

    • Register a ready-made connection instance.

      Parameters

      • name: string

        The connection name.

      • connection: QueueConnection

        The connection instance.

      Returns this

      This manager for chaining.

    • Register a lazy factory for a connection (built on first access).

      Parameters

      Returns this

      This manager for chaining.

    • Set the default connection name.

      Parameters

      • name: string

        The connection name.

      Returns this

      This manager for chaining.

    • Create a QueueManager.

      Parameters

      • defaultConnection: string = 'memory'

        The default connection name.

      Returns QueueManager

      A new manager.

    • The process-wide default manager, if the queue module has been booted.

      Returns QueueManager

      The manager, or undefined.

    • Register (or replace) the process-wide default manager.

      Parameters

      • Optionalmanager: QueueManager

        The manager (or undefined to clear).

      Returns void