docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class WebTask

    Represents an asynchronous operation for single-threaded environments.

    Inheritance
    object
    WebTask
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Meta.InstantGames.Runtime
    Assembly: Unity.Meta.InstantGames.Runtime.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<WebTask> 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
    WebTask

    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
    WebTaskAwaiter

    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.

    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)