Script API - v26.50.24
    Preparing search index...

    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.

    export class TaskPromiseBase {
    private constructor();
    readonly cancelled: boolean;
    readonly progress: number;
    cancel(): void;
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    cancelled: boolean

    Whether cancellation was accepted for the task.

    This property can't be read in early-execution mode.

    progress: number

    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.

    This property can't be read in early-execution mode.

    Methods

    • Returns void

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

      no-restricted-execution - This function can't be called in restricted-execution mode.

      This function can't be called in early-execution mode.