pubsub namespace

Functions

FunctionDescription
schedule(schedule)Registers a Cloud Function to run at specified times.
topic(topic)Registers a Cloud Function triggered when a Google Cloud Pub/Sub message is sent to a specified topic.

Classes

ClassDescription
MessageInterface representing a Google Cloud Pub/Sub message.
ScheduleBuilderThe builder for scheduled functions, which are powered by Google Pub/Sub and Cloud Scheduler. Describes the Cloud Scheduler job that is deployed to trigger a scheduled function at the provided frequency. For more information, see [Schedule functions](/docs/functions/schedule-functions).Access viafunctions.pubsub.schedule().
TopicBuilderThe Google Cloud Pub/Sub topic builder.Access viafunctions.pubsub.topic().

pubsub.schedule()

Registers a Cloud Function to run at specified times.

Signature:

exportdeclarefunctionschedule(schedule:string):ScheduleBuilder;

Parameters

ParameterTypeDescription
schedulestringThe schedule, in Unix Crontab or AppEngine syntax.

Returns:

ScheduleBuilder

ScheduleBuilder interface.

pubsub.topic()

Registers a Cloud Function triggered when a Google Cloud Pub/Sub message is sent to a specified topic.

Signature:

exportdeclarefunctiontopic(topic:string):TopicBuilder;

Parameters

ParameterTypeDescription
topicstringThe Pub/Sub topic to watch for message events.

Returns:

TopicBuilder

Pub/Sub topic builder interface.

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.