Fake Mirrors
    Preparing search index...

    Class BullWebhookQueue

    Bull-based webhook queue implementation.

    Depends:

    import { DIContainer } from '@famir/common'
    import { BullWebhookQueue } from '@famir/producer'

    // Get container singleton
    const container = DIContainer.getInstance()

    // Register dependency in container
    BullWebhookQueue.register(container)
    import { DIContainer } from '@famir/common'
    import { WEBHOOK_QUEUE, WebhookQueue } from '@famir/domain'

    // Get container singleton
    const container = DIContainer.getInstance()

    // Resolve dependency from container
    const webhookQueue = container.resolve<BullWebhookQueue>(WEBHOOK_QUEUE)

    // TODO more examples

    Hierarchy (View Summary)

    Implements

    • Adds a new job to the webhook queue.

      Parameters

      • name: string

        The name of the job to be added.

      • data: WebhookJobData

        The arbitrary data to append to the job.

      Returns Promise<void>

      ProducerError If adding job fails.

    • Gracefully closes the queue.

      This method should be called during application shutdown.

      Returns Promise<void>

      LifecycleError If the queue cannot be closed properly.

    • Retrieves the total number of jobs in the queue.

      Returns Promise<number>

      The total job count.

      ProducerError If the count cannot be retrieved.

    • Retrieves the workers for the queue.

      Returns Promise<object[]>

      The queue workers list.

      ProducerError If the workers cannot be retrieved.

    • Registers the webhook queue as a singleton in the DI container.

      Parameters

      • container: DIContainer

        The DI container to register in.

      Returns void