tasks namespace

Functions

Function Description
onTaskDispatched(handler) Creates a handler for tasks sent to a Google Cloud Tasks queue.
onTaskDispatched(options, handler) Creates a handler for tasks sent to a Google Cloud Tasks queue.

Interfaces

Interface Description
AuthData Metadata about the authorization used to invoke a function.
RateLimits How congestion control should be applied to the function.
RetryConfig How a task should be retried in the event of a non-2xx return.
TaskQueueFunction A handler for tasks.
TaskQueueOptions

Type Aliases

Type Alias Description
Request The request used to call a task queue function.

tasks.onTaskDispatched()

Creates a handler for tasks sent to a Google Cloud Tasks queue.

Signature:

export declare function onTaskDispatched<Args = any>(handler: (request: Request<Args>) => void | Promise<void>): TaskQueueFunction<Args>;

Parameters

Parameter Type Description
handler (request: Request<Args>) => void | Promise<void> A callback to handle task requests.

Returns:

TaskQueueFunction<Args>

A function you can export and deploy.

tasks.onTaskDispatched()

Creates a handler for tasks sent to a Google Cloud Tasks queue.

Signature:

export declare function onTaskDispatched<Args = any>(options: TaskQueueOptions, handler: (request: Request<Args>) => void | Promise<void>): TaskQueueFunction<Args>;

Parameters

Parameter Type Description
options TaskQueueOptions Configuration for the task queue or Cloud Function.
handler (request: Request<Args>) => void | Promise<void> A callback to handle task requests.

Returns:

TaskQueueFunction<Args>

A function you can export and deploy.

tasks.Request

The request used to call a task queue function.

Signature:

export type Request<T = any> = TaskContext & {
    data: T;
};