Search Results for

    Show / Hide Table of Contents

    Class FutureExtensions

    Windows only Future extensions

    Inheritance
    System.Object
    FutureExtensions
    Namespace: FM.LiveSwitch
    Assembly: FM.LiveSwitch.dll
    Syntax
    public static class FutureExtensions : object

    Methods

    AsPromise(Task)

    Converts a .NET Task to a promise.

    Declaration
    public static Promise<object> AsPromise(this Task task)
    Parameters
    Type Name Description
    Task task

    The task.

    Returns
    Type Description
    Promise<System.Object>

    AsPromise<T>(Task<T>)

    Converts a .NET Task to a promise.

    Declaration
    public static Promise<T> AsPromise<T>(this Task<T> task)
        where T : class
    Parameters
    Type Name Description
    Task<T> task

    The task.

    Returns
    Type Description
    Promise<T>
    Type Parameters
    Name Description
    T

    AsPromisePrimitive<T>(Task<T>)

    Converts a .NET Task to a promise.

    Declaration
    public static Promise<Unit<T>> AsPromisePrimitive<T>(this Task<T> task)
        where T : struct
    Parameters
    Type Name Description
    Task<T> task

    The task.

    Returns
    Type Description
    Promise<Unit<T>>
    Type Parameters
    Name Description
    T

    AsTask<T>(Future<T>)

    Converts a future to a .NET Task.

    Declaration
    public static Task<T> AsTask<T>(this Future<T> future)
        where T : class
    Parameters
    Type Name Description
    Future<T> future

    The future.

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T

    AsTask<T>(Future<T>, TaskCreationOptions)

    Converts a future to a .NET Task with specific task creation options.

    Declaration
    public static Task<T> AsTask<T>(this Future<T> future, TaskCreationOptions creationOptions)
        where T : class
    Parameters
    Type Name Description
    Future<T> future

    The future.

    TaskCreationOptions creationOptions

    The task creation options.

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T

    AsTaskAsync<T>(Future<T>)

    Converts a future to a .NET Task with TaskCreationOptions.RunContinuationsAsynchronously, which forces continuations added to the task to be executed asynchronously.

    Declaration
    public static Task<T> AsTaskAsync<T>(this Future<T> future)
        where T : class
    Parameters
    Type Name Description
    Future<T> future

    The future.

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T

    GetAwaiter<T>(Future<T>)

    Enables await support for promises. Should not be called directly.

    Declaration
    public static TaskAwaiter<T> GetAwaiter<T>(this Future<T> future)
        where T : class
    Parameters
    Type Name Description
    Future<T> future

    The future.

    Returns
    Type Description
    TaskAwaiter<T>
    Type Parameters
    Name Description
    T
    In This Article
    Back to top Copyright © LiveSwitch Inc. All Rights Reserved. Doc build for LiveSwitch v1.15.0