Documentation
    Preparing search index...

    Module @quatrain/queue-gcp

    @quatrain/queue-gcp

    The Google Cloud Pub/Sub adapter for @quatrain/queue.

    Google Cloud Pub/Sub is a global messaging and routing service. While slightly different from traditional queues (it's built around publishers and subscribers), this adapter maps the Quatrain queue API to Pub/Sub topics and subscriptions to facilitate background workers.

    npm install @quatrain/queue-gcp @google-cloud/pubsub
    # or
    yarn add @quatrain/queue-gcp @google-cloud/pubsub

    Register the adapter using your Google Cloud credentials.

    import { Queue } from '@quatrain/queue'
    import { PubSubAdapter } from '@quatrain/queue-gcp'

    const pubsubAdapter = new PubSubAdapter({
    config: {
    projectId: process.env.GCP_PROJECT_ID,
    clientEmail: process.env.GCP_CLIENT_EMAIL,
    privateKey: process.env.GCP_PRIVATE_KEY
    }
    })

    Queue.addAdapter('pubsub', pubsubAdapter, true)

    For concrete examples and usage guides, please refer to the How-To Guide.

    AGPL-3.0-only

    Classes

    PubSubQueueAdapter