Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

Promise<T>

class Promise<T>

Module: System.Concurrency.Tasks
Assembly: System.Runtime.dll
Source file: Tasks.rvn

Inheritance: Object → Promise<T>

Producer authority to complete or cancel one task.

Type parameters

Name Description
T The value type carried by successful completion, including Result values for expected failures.

Remarks

The first successful terminal operation wins. Subsequent Complete or Cancel calls return false. Continuations are queued. This is not a thread-safe shared-memory primitive or a cancellation-token source.

Constructors

2 items
Promise() Creates a promise on the current queue, falling back to the invocation’s default queue.
Promise(queue: TaskQueue) Creates a promise on an explicit queue.

Properties

1 item
Task: Task<T> Gets the stable consumer handle for this promise.

Methods

6 items
Cancel() -> bool Cancels a pending task and posts its registered callbacks.
Complete(value: T) -> bool Completes a pending task with a value and posts its registered callbacks.
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString