@quatrain/queue-gcp 1.1.20 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @quatrain/queue-gcp
|
|
2
|
+
|
|
3
|
+
The Google Cloud Pub/Sub adapter for `@quatrain/queue`.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @quatrain/queue-gcp @google-cloud/pubsub
|
|
13
|
+
# or
|
|
14
|
+
yarn add @quatrain/queue-gcp @google-cloud/pubsub
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Register the adapter using your Google Cloud credentials.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { Queue } from '@quatrain/queue'
|
|
23
|
+
import { PubSubAdapter } from '@quatrain/queue-gcp'
|
|
24
|
+
|
|
25
|
+
const pubsubAdapter = new PubSubAdapter({
|
|
26
|
+
config: {
|
|
27
|
+
projectId: process.env.GCP_PROJECT_ID,
|
|
28
|
+
clientEmail: process.env.GCP_CLIENT_EMAIL,
|
|
29
|
+
privateKey: process.env.GCP_PRIVATE_KEY
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
Queue.addAdapter('pubsub', pubsubAdapter, true)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
AGPL-3.0-only
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/queue-gcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.22",
|
|
4
4
|
"description": "Queue adapter for Google Cloud Platform PubSub",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@google-cloud/pubsub": "^4.7.0",
|
|
31
|
-
"@quatrain/core": "^1.1.
|
|
32
|
-
"@quatrain/queue": "^1.1.
|
|
31
|
+
"@quatrain/core": "^1.1.49",
|
|
32
|
+
"@quatrain/queue": "^1.1.29"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"test-ci": "jest --runInBand",
|