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 via functions.pubsub.schedule().

Signature:

export declare class ScheduleBuilder 

Constructors

Constructor Modifiers Description
(constructor)(triggerResource, options) Constructs a new instance of the ScheduleBuilder 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 the ScheduleBuilder 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:

ScheduleBuilder

pubsub.ScheduleBuilder.timeZone()

Signature:

timeZone(timeZone: string): ScheduleBuilder;

Parameters

Parameter Type Description
timeZone string

Returns:

ScheduleBuilder