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 via functions.pubsub.schedule()
.
Signature:
export declare class ScheduleBuilder
Constructors
Methods
pubsub.ScheduleBuilder.(constructor)
Constructs a new instance of the ScheduleBuilder
class
Signature:
constructor(triggerResource: () => string, options: DeploymentOptions);
Parameters
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
Returns:
ScheduleBuilder
pubsub.ScheduleBuilder.timeZone()
Signature:
timeZone(timeZone: string): ScheduleBuilder;
Parameters
Parameter |
Type |
Description |
timeZone |
string |
|
Returns:
ScheduleBuilder
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-04-24 UTC.
[null,null,["Last updated 2023-04-24 UTC."],[],[],null,["# pubsub.ScheduleBuilder class\n\nThe 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).\n\nAccess via `functions.pubsub.schedule()`.\n\n**Signature:** \n\n export declare class ScheduleBuilder \n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|----------------------------------------------------------------------------------------------------------------------------|-----------|----------------------------------------------------------|\n| [(constructor)(triggerResource, options)](./firebase-functions.pubsub.schedulebuilder.md#pubsubschedulebuilderconstructor) | | Constructs a new instance of the `ScheduleBuilder` class |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|--------------------------------------------------------------------------------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------|\n| [onRun(handler)](./firebase-functions.pubsub.schedulebuilder.md#pubsubschedulebuilderonrun) | | Event handler for scheduled functions. Triggered whenever the associated scheduler job sends a Pub/Sub message. |\n| [retryConfig(config)](./firebase-functions.pubsub.schedulebuilder.md#pubsubschedulebuilderretryconfig) | | |\n| [timeZone(timeZone)](./firebase-functions.pubsub.schedulebuilder.md#pubsubschedulebuildertimezone) | | |\n\npubsub.ScheduleBuilder.(constructor)\n------------------------------------\n\nConstructs a new instance of the `ScheduleBuilder` class\n\n**Signature:** \n\n constructor(triggerResource: () =\u003e string, options: DeploymentOptions);\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------------|--------------------------------------------------------------------------------------------|-------------|\n| triggerResource | () =\\\u003e string | |\n| options | [DeploymentOptions](./firebase-functions.deploymentoptions.md#deploymentoptions_interface) | |\n\npubsub.ScheduleBuilder.onRun()\n------------------------------\n\nEvent handler for scheduled functions. Triggered whenever the associated scheduler job sends a Pub/Sub message.\n\n**Signature:** \n\n onRun(handler: (context: EventContext) =\u003e PromiseLike\u003cany\u003e | any): CloudFunction\u003cunknown\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|\n| handler | (context: [EventContext](./firebase-functions.eventcontext.md#eventcontext_interface)) =\\\u003e PromiseLike\\\u003cany\\\u003e \\| any | Handler that fires whenever the associated scheduler job sends a Pub/Sub message. |\n\n**Returns:**\n\n[CloudFunction](./firebase-functions.cloudfunction.md#cloudfunction_interface)\\\u003cunknown\\\u003e\n\nA function that you can export and deploy.\n\npubsub.ScheduleBuilder.retryConfig()\n------------------------------------\n\n**Signature:** \n\n retryConfig(config: ScheduleRetryConfig): ScheduleBuilder;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------------------------------------------------------------------------------------------------|-------------|\n| config | [ScheduleRetryConfig](./firebase-functions.scheduleretryconfig.md#scheduleretryconfig_interface) | |\n\n**Returns:**\n\n[ScheduleBuilder](./firebase-functions.pubsub.schedulebuilder.md#pubsubschedulebuilder_class)\n\npubsub.ScheduleBuilder.timeZone()\n---------------------------------\n\n**Signature:** \n\n timeZone(timeZone: string): ScheduleBuilder;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|-------------|\n| timeZone | string | |\n\n**Returns:**\n\n[ScheduleBuilder](./firebase-functions.pubsub.schedulebuilder.md#pubsubschedulebuilder_class)"]]