pubsub.ScheduleBuilder class

The 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().

Signature:

exportdeclareclassScheduleBuilder

Constructors

ConstructorModifiersDescription
(constructor)(triggerResource, options)Constructs a new instance of theScheduleBuilder class

Methods

MethodModifiersDescription
onRun(handler)Event handler for scheduled functions. Triggered whenever the associated scheduler job sends a Pub/Sub message.
retryConfig(config)
timeZone(timeZone)

pubsub.ScheduleBuilder.(constructor)

Constructs a new instance of theScheduleBuilder class

Signature:

constructor(triggerResource:()=>string,options:DeploymentOptions);

Parameters

ParameterTypeDescription
triggerResource() => string
optionsDeploymentOptions

pubsub.ScheduleBuilder.onRun()

Event handler for scheduled functions. Triggered whenever the associated scheduler job sends a Pub/Sub message.

Signature:

onRun(handler:(context:EventContext)=>PromiseLike<any>|any):CloudFunction<unknown>;

Parameters

ParameterTypeDescription
handler(context:EventContext) => PromiseLike<any> | anyHandler that fires whenever the associated scheduler job sends a Pub/Sub message.

Returns:

CloudFunction<unknown>

A function that you can export and deploy.

pubsub.ScheduleBuilder.retryConfig()

Signature:

retryConfig(config:ScheduleRetryConfig):ScheduleBuilder;

Parameters

ParameterTypeDescription
configScheduleRetryConfig

Returns:

ScheduleBuilder

pubsub.ScheduleBuilder.timeZone()

Signature:

timeZone(timeZone:string):ScheduleBuilder;

Parameters

ParameterTypeDescription
timeZonestring

Returns:

ScheduleBuilder

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.