Class WebTask
Represents an asynchronous operation for single-threaded environments.
Inherited Members
Namespace: Meta.InstantGames .Runtime
Assembly: Unity.Meta.InstantGames.Sdk.dll
Syntax
public class WebTask
Constructors
WebTask()
Initializes a new task.
Declaration
public WebTask()
Properties
Exception
The exception that caused the task to end prematurely. If the task completed successfully or has not yet thrown any exceptions, this will be null.
Declaration
public Exception Exception { get; }
Property Value
Type | Description |
---|---|
Exception |
IsCompleted
Indicates whether the task has completed.
Declaration
public bool IsCompleted { get; }
Property Value
Type | Description |
---|---|
bool |
IsFaulted
Indicates whether the task completed due to an unhandled exception.
Declaration
public bool IsFaulted { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
ContinueWith(Action<WebTask>)
Creates a continuation that executes asynchronously when the target task completes.
Declaration
public WebTask ContinueWith(Action<WebTask> action)
Parameters
Type | Name | Description |
---|---|---|
Action<Web |
action | An action to run when the task completes. When run, the delegate will be passed the completed task as an argument. |
Returns
Type | Description |
---|---|
Web |
A new continuation task. |
GetAwaiter()
Gets an awaiter used to await this task. Required member to make the task awaitable. This API supports the product infrastructure and is not intended to be used directly from your code.
Declaration
public WebTaskAwaiter GetAwaiter()
Returns
Type | Description |
---|---|
Web |
An awaiter instance. |
WaitForCompletion()
Waits for the task to complete execution. The method is intended to support compatibility with Unity coroutines.
Declaration
public IEnumerator WaitForCompletion()
Returns
Type | Description |
---|---|
IEnumerator | An enumerator that is iterable until the task completes, at which point iteration will stop. |