Stone.js API
    Preparing search index...

    The long-running queue consumer.

    It reserves the next job, resolves its handler from the JobRegistry, runs it, and acknowledges it; on failure it retries with linear backoff up to maxAttempts, then dead-letters. On serverless there is no worker: the provider adapter invokes per message and routes to the same registry.

    Index
    • Drain every currently-ready job across the given queues (one pass).

      Parameters

      • queues: string[] = ...

        The queues to drain.

      • Optionalconnection: string

        The connection name.

      Returns Promise<number>

      The number of jobs processed.

    • Whether the worker is currently running.

      Returns boolean

      True while the loop is active.

    • Reserve and process one job from a queue.

      Parameters

      • queue: string = DEFAULT_QUEUE

        The queue to consume.

      • Optionalconnection: string

        The connection name.

      Returns Promise<boolean>

      True when a job was processed, false when the queue was empty.

    • Sleep for the given milliseconds (extracted so it can be controlled in tests).

      Parameters

      • ms: number

        Milliseconds to sleep.

      Returns Promise<void>

    • Stop the consume loop.

      Returns void