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 via functions.pubsub.schedule().
TopicBuilderThe Google Cloud Pub/Sub topic builder.Access via functions.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.