Task
class in OpalScript
Owned asynchronous work. Compose with All and Race; cancel from the owner.
Properties
| Member | Description |
|---|---|
| Task.Id | Read-only task state. |
| Task.Status | Read-only task state. |
| Task.Reason | Read-only task state. |
| Task.IsCompleted | Read-only task state. |
| Task.IsCanceled | Read-only task state. |
| Task.IsFailed | Read-only task state. |
| Task.Result | The completed result. Only present when the task result type is not void. |
Methods
| Member | Description |
|---|---|
| Task.All | Wait for all input tasks. Up to 64 heterogeneous tasks, or a snapshot of one task list. Empty input completes. Task.All<T> requires matching Task<T> inputs and returns Task<List<T>> in input order; T cannot be void or List. Composition is owned asynchronous work. |
| Task.Race | Wait for the first terminal input task. Up to 64 tasks with exactly the same result type, or a snapshot of one task list. Empty input is rejected. Task.Race<T> makes the shared result type explicit. Composition is owned asynchronous work. |
| Task.Cancel | Cancel this owned task and run its synchronous finally cleanup. |