Class TaskProgress

A asynchronous operation being executed on the engine. This can be used to track progress of an operation, cancel it or be notified when it finishes.

Hierarchy

  • FrameworkObject
    • TaskProgress

Constructors

  • Parameters

    • OptionalisInternalConstructor: boolean

    Returns TaskProgress

Accessors

  • get cancellationRequested(): boolean
  • Checks if the operation was canceled by the user.

    Returns boolean

  • get description(): string
  • A human readable name for the operation. Can be used to display the operation progress in a UI.

    Returns string

  • get error(): string
  • Returns the error returned by the operation, in case it has failed.

    Returns string

  • get flags(): EnumValue<TaskProgressFlag, number>
  • Returns the asynchronous operation flags. The flags can be used to query what is supported by the operation. For example, EditorAsynchronousOperationFlag::Cancellable will be set if the operation can be canceled by the user.

    Returns EnumValue<TaskProgressFlag, number>

  • get name(): string
  • A human readable description for the operation. Can be used to display the operation progress in a UI.

    Returns string

  • get progress(): number
  • Returns the current progress of the operation.

    Returns number

  • get tag(): string
  • A human readable tag to classify this operation. Could represent that this operation is part of a larger operation. If no tag were provided, the name will be used instead.

    Returns string

Methods

  • Cancels the asynchronous operation. Cancellation is only possible if EditorAsynchronousOperationFlag::Cancellable is defined.

    Returns void

  • Cancels the operation. A notification will be scheduled to notify the user that the operation has been canceled. This method is usually only called if isCancellationRequested() returns true.

    Returns void

  • Finishes the operation execution. A notification will be scheduled to notify the user that the operation bas been completed. Calling this method explicitly is usually not required as it will be implicitly called by the destructor when the handle is destroyed.

    Returns void

  • Fails the operation. A notification will be scheduled to notify the user that the operation has failed.

    Parameters

    • error: string

    Returns void

  • Reports progress of the operation. A notification will be scheduled to notify the user of the new progress of the operation.

    Parameters

    • progress: number

    Returns void

  • Starts the operation execution. A notification will be scheduled to notify the user that the operation has started execution. Calling this method is required whenever the operation starts execution.

    Returns void

Events

onComplete: Event<[], void>

An event triggered whenever the operation completes.

onFail: Event<[string], void>

An event triggered whenever the operation fails.

onUpdate: Event<[], void>

An event triggered once per frame, while the task is Playing.

onProgressChange: Event<[number], void>

An event triggered once per frame to notify that the operation has progressed.