pubsub.TopicBuilder class Stay organized with collections Save and categorize content based on your preferences.
The Google Cloud Pub/Sub topic builder.
Access viafunctions.pubsub.topic().
Signature:
exportdeclareclassTopicBuilderConstructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(triggerResource, options) | Constructs a new instance of theTopicBuilder class |
Methods
| Method | Modifiers | Description |
|---|---|---|
| onPublish(handler) | Event handler that fires every time a Cloud Pub/Sub message is published. |
pubsub.TopicBuilder.(constructor)
Constructs a new instance of theTopicBuilder class
Signature:
constructor(triggerResource:()=>string,options:DeploymentOptions);Parameters
| Parameter | Type | Description |
|---|---|---|
| triggerResource | () => string | |
| options | DeploymentOptions |
pubsub.TopicBuilder.onPublish()
Event handler that fires every time a Cloud Pub/Sub message is published.
Signature:
onPublish(handler:(message:Message,context:EventContext)=>PromiseLike<any>|any):CloudFunction<Message>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (message:Message, context:EventContext) => PromiseLike<any> | any | Event handler that runs every time a Cloud Pub/Sub message is published. |
Returns:
A function that you can export and deploy.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-04-24 UTC.