Struct WebTaskAwaiter
Provides an object that waits for the completion of an asynchronous task.
Inherited Members
Namespace: Meta.InstantGames.Runtime
Assembly: Unity.Meta.InstantGames.Sdk.dll
Syntax
public readonly struct WebTaskAwaiter : ICriticalNotifyCompletion, INotifyCompletionConstructors
WebTaskAwaiter(WebTask)
Initializes a new task awaiter with the given task.
Declaration
public WebTaskAwaiter(WebTask task)Parameters
| Type | Name | Description | 
|---|---|---|
| WebTask | 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 void GetResult()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. |