---
title: "PubSubJobQueueStrategy"
generated: true
---
<GenerationInfo sourceFile="packages/job-queue-plugin/src/pub-sub/pub-sub-job-queue-strategy.ts" sourceLine="29" packageName="@vendure/job-queue-plugin" />

This JobQueueStrategy uses Google Cloud Pub/Sub to implement a job queue for Vendure.
It should not be used alone, but as part of the <DocsLink href="/reference/core-plugins/job-queue-plugin/pub-sub-plugin#pubsubplugin">PubSubPlugin</DocsLink>.

Note: To use this strategy, you need to manually install the `@google-cloud/pubsub` package:

```shell
npm install

```ts title="Signature"
class PubSubJobQueueStrategy extends InjectableJobQueueStrategy implements JobQueueStrategy {
    init(injector: Injector) => ;
    destroy() => ;
    add(job: Job<Data>) => Promise<Job<Data>>;
    start(queueName: string, process: (job: Job<Data>) => Promise<any>) => ;
    stop(queueName: string, process: (job: Job<Data>) => Promise<any>) => ;
}
```
* Extends: InjectableJobQueueStrategy


* Implements: JobQueueStrategy



<div className="members-wrapper">

### init

<MemberInfo kind="method" type={`(injector: Injector) => `}   />


### destroy

<MemberInfo kind="method" type={`() => `}   />


### add

<MemberInfo kind="method" type={`(job: Job<Data>) => Promise<Job<Data>>`}   />


### start

<MemberInfo kind="method" type={`(queueName: string, process: (job: Job<Data>) => Promise<any>) => `}   />


### stop

<MemberInfo kind="method" type={`(queueName: string, process: (job: Job<Data>) => Promise<any>) => `}   />




</div>
