TaskQueue class

TheTaskQueue interface.

Signature:

exportdeclareclassTaskQueue<Args=Record<string,any>>

Methods

MethodModifiersDescription
delete(id)Deletes an enqueued task if it has not yet completed.
enqueue(data, opts)Creates a task and adds it to the queue. Tasks cannot be updated after creation. This action requirescloudtasks.tasks.create IAM permission on the service account.

TaskQueue.delete()

Deletes an enqueued task if it has not yet completed.

Signature:

delete(id:string):Promise<void>;

Parameters

ParameterTypeDescription
idstringthe ID of the task, relative to this queue.

Returns:

Promise<void>

A promise that resolves when the task has been deleted.

TaskQueue.enqueue()

Creates a task and adds it to the queue. Tasks cannot be updated after creation. This action requirescloudtasks.tasks.create IAM permission on the service account.

Signature:

enqueue(data:Args,opts?:TaskOptions):Promise<void>;

Parameters

ParameterTypeDescription
dataArgsThe data payload of the task.
optsTaskOptionsOptional options when enqueuing a new task.

Returns:

Promise<void>

A promise that resolves when the task has successfully been added to the queue.

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-07-12 UTC.