pubsub.ScheduleBuilder class Stay organized with collections Save and categorize content based on your preferences.
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:
exportdeclareclassScheduleBuilderConstructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(triggerResource, options) | Constructs a new instance of theScheduleBuilder class |
Methods
| Method | Modifiers | Description |
|---|---|---|
| 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
| Parameter | Type | Description |
|---|---|---|
| triggerResource | () => string | |
| options | DeploymentOptions |
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
| Parameter | Type | Description |
|---|---|---|
| handler | (context:EventContext) => PromiseLike<any> | any | Handler 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
| Parameter | Type | Description |
|---|---|---|
| config | ScheduleRetryConfig |
Returns:
pubsub.ScheduleBuilder.timeZone()
Signature:
timeZone(timeZone:string):ScheduleBuilder;Parameters
| Parameter | Type | Description |
|---|---|---|
| timeZone | string |
Returns:
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.