docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct WebTaskAwaiter

    Provides an object that waits for the completion of an asynchronous task.

    Implements
    ICriticalNotifyCompletion
    INotifyCompletion
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Meta.InstantGames.Runtime
    Assembly: Unity.Meta.InstantGames.Runtime.dll
    Syntax
    public readonly struct WebTaskAwaiter : ICriticalNotifyCompletion, INotifyCompletion

    Constructors

    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.

    Implements

    ICriticalNotifyCompletion
    INotifyCompletion
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)