docs.unity3d.com
    Show / Hide Table of Contents

    Interface IAsyncComponent

    Interface to implement by a component to be able to run a C# async task.

    Inherited Members
    IRunnableComponent.Tick(TimeSpan)
    Namespace: Unity.Reflect.ActorFramework
    Syntax
    public interface IAsyncComponent : IRunnableComponent

    Methods

    WaitAsync(CancellationToken)

    Method called by the actor system in loop. When the task completes, this method is immediately re-executed, and the component's Tick(TimeSpan) method is scheduled to be executed. If data is shared between the component and the actor, this is the responsibility of the user to implement a synchronization mechanism, as WaitAsync(CancellationToken) and Tick(TimeSpan) may be executed simultaneously.

    Declaration
    Task<WaitResult> WaitAsync(CancellationToken token)
    Parameters
    Type Name Description
    CancellationToken token

    A token to be able to cancel the task.

    Returns
    Type Description
    Task<WaitResult>

    A task with a result to be re-executed again or to stop, both possible results signal the scheduler to execute the Tick(TimeSpan) method.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023