-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a9a5d9
commit 4bddf86
Showing
14 changed files
with
13,207 additions
and
7,028 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
version: "3" | ||
version: '3.3' | ||
|
||
services: | ||
pubsub: | ||
image: messagebird/gcloud-pubsub-emulator:latest | ||
image: gcr.io/google.com/cloudsdktool/cloud-sdk:416.0.0-emulators | ||
entrypoint: gcloud | ||
command: ["beta", "emulators", "pubsub", "start", "--host-port=0.0.0.0:8681"] | ||
ports: | ||
- '8681:8681' | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import { Message } from '@google-cloud/pubsub'; | ||
import { BaseRpcContext } from '@nestjs/microservices/ctx-host/base-rpc.context'; | ||
|
||
type GCPubSubContextArgs = [Message, string]; | ||
type GCPubSubContextArgs<P> = [Message, P]; | ||
|
||
export class GCPubSubContext extends BaseRpcContext<GCPubSubContextArgs> { | ||
constructor(args: GCPubSubContextArgs) { | ||
export class GCPubSubContext<P = string> extends BaseRpcContext< | ||
GCPubSubContextArgs<P> | ||
> { | ||
constructor(args: GCPubSubContextArgs<P>) { | ||
super(args); | ||
} | ||
|
||
/** | ||
* Returns the original message (with properties, fields, and content). | ||
*/ | ||
getMessage() { | ||
getMessage(): Message { | ||
return this.args[0]; | ||
} | ||
|
||
/** | ||
* Returns the name of the pattern. | ||
*/ | ||
getPattern() { | ||
getPattern(): P { | ||
return this.args[1]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.