MixedReality-WebRTC MixedReality-WebRTC
Search Results for

    Show / Hide Table of Contents

    Class AsyncInitHelper<T>

    Utility for resources in Unity components that need asynchronous initialization, and don't match well the Unity synchronous enable/disable workflow.

    Inheritance
    Object
    AsyncInitHelper<T>
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.WebRTC.Unity
    Assembly: cs.temp.dll.dll
    Syntax
    public class AsyncInitHelper<T>
        where T : class, IDisposable
    Type Parameters
    Name Description
    T
    Remarks

    This keeps track of an initialization task, allows callers to poll for the initialized object, and handles cancellation/cleanup if the initialization is aborted before it has completed.

    Properties

    Result

    Check if the initialization task has generated a result.

    Declaration
    public T Result { get; }
    Property Value
    Type Description
    T

    The result of the initialization task if there is one and it has just successfully completed; null if there is no task.

    Remarks

    If the initialization fails with an exception, this rethrows the exception.

    Methods

    AbortInitTask()

    Cancel the initialization task and dispose its result when it completes.

    Declaration
    public Task AbortInitTask()
    Returns
    Type Description
    Task

    A that will complete when the initialization task has ended and its result has been disposed.

    Remarks

    Any exceptions from the initialization task are silently dropped.

    TrackInitTask(Task<T>, CancellationTokenSource)

    Starts tracking an initialization task for a resource.

    Declaration
    public void TrackInitTask(Task<T> initTask, CancellationTokenSource cts = null)
    Parameters
    Type Name Description
    Task<T> initTask
    CancellationTokenSource cts

    This will be used to cancel the task if aborted before it has finished. Will be disposed at the end of the task.

    In This Article
    Back to top Generated by DocFX