Skip to main content

PubSubJobQueueStrategy

PubSubJobQueueStrategy

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 PubSubPlugin.

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

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

init

method
(injector: Injector) =>

destroy

method
() =>

add

method
(job: Job<Data>) => Promise<Job<Data>>

start

method
(queueName: string, process: (job: Job<Data>) => Promise<any>) =>

stop

method
(queueName: string, process: (job: Job<Data>) => Promise<any>) =>