Struct WebTaskAwaiter<T>
Represents an object that waits for the completion of an asynchronous task and provides a parameter for the result.
Inherited Members
Namespace: Meta.InstantGames .Runtime
Assembly: Unity.Meta.InstantGames.Sdk.dll
Syntax
public readonly struct WebTaskAwaiter<T> : ICriticalNotifyCompletion, INotifyCompletion
Type Parameters
Name | Description |
---|---|
T | The result for the task. |
Constructors
WebTaskAwaiter(WebTask<T>)
Initializes a new task awaiter with the given task.
Declaration
public WebTaskAwaiter(WebTask<T> task)
Parameters
Type | Name | Description |
---|---|---|
Web |
task | Represents the task to await. |
Properties
IsCompleted
Indicates whether the asynchronous task has completed. Required member for a task awaiter.
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
GetResult()
Ends the wait for the completion of the asynchronous task. Required member for a task awaiter.
Declaration
public T GetResult()
Returns
Type | Description |
---|---|
T | The result of the completed task. |
OnCompleted(Action)
Sets the action to perform when the task awaiter object stops waiting for the asynchronous task to complete. Required member for a task awaiter. This API supports the product infrastructure and is not intended to be used directly from your code.
Declaration
public void OnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
Action | continuation | The action to perform when the wait operation completes. |
UnsafeOnCompleted(Action)
Sets the action to perform when the task awaiter object stops waiting for the asynchronous task to complete. Required member for a task awaiter. This API supports the product infrastructure and is not intended to be used directly from your code.
Declaration
public void UnsafeOnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
Action | continuation | The action to perform when the wait operation completes. |