For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/TaskPromiseBase.md.

Class: TaskPromiseBase experimental

Beta

Provides shared cancellation controls for an asynchronous Editor task. Calling cancel requests cancellation; when cancellation is accepted, cancelled becomes true and the task promise rejects with a TaskCancelledError when the coroutine scheduler next processes the task. Cancellation does not undo changes that the task already applied.

Extended by

Properties

cancelled

readonly cancelled: boolean

Beta

Remarks

Whether cancellation was accepted for the task.


progress

readonly progress: number

Beta

Remarks

The current normalized task progress from 0 to 1. Task groups report the average progress of their constituent tasks. Successful tasks report 1 after settlement; failed or cancelled tasks retain their last observed progress.

Methods

cancel()

cancel(): void

World Mutation Beta

Returns

void

Remarks

Requests cancellation of the task. Calling this method more than once, or after the task has settled, has no effect.

Privilege

Tip

no-restricted-execution -