Search Results for

    Show / Hide Table of Contents

    Class TaskExtensions

    Defines a collection of extensions for tasks.

    Inheritance
    System.Object
    TaskExtensions
    Namespace: MADE.Threading
    Assembly: MADE.Threading.dll
    Syntax
    public static class TaskExtensions : object

    Methods

    | Improve this Doc View Source

    AndObserveExceptions(Task, Action<Exception>)

    Observes the exceptions of faulted tasks.

    Declaration
    public static Task AndObserveExceptions(this Task task, Action<Exception> onException = null)
    Parameters
    Type Name Description
    Task task

    The task to observe for exceptions.

    Action<Exception> onException

    An action invoked when an exception is caught.

    Returns
    Type Description
    Task

    An asynchronous operation.

    | Improve this Doc View Source

    AndObserveExceptions<T>(Task<T>, Action<Exception>)

    Observes the exceptions of faulted tasks.

    Declaration
    public static Task<T> AndObserveExceptions<T>(this Task<T> task, Action<Exception> onException = null)
    Parameters
    Type Name Description
    Task<T> task

    The task to observe for exceptions.

    Action<Exception> onException

    An action invoked when an exception is caught.

    Returns
    Type Description
    Task<T>

    An asynchronous operation.

    Type Parameters
    Name Description
    T

    The instance type for the listener.

    | Improve this Doc View Source

    WhenAll(IEnumerable<Task>)

    Creates a task that will complete when all of the objects in the collection have completed.

    Declaration
    public static async Task WhenAll(this IEnumerable<Task> tasks)
    Parameters
    Type Name Description
    IEnumerable<Task> tasks

    The tasks to wait on for completion.

    Returns
    Type Description
    Task

    A task that represents the completion of all of the supplied tasks.

    | Improve this Doc View Source

    WhenAny(IEnumerable<Task>)

    Creates a task that will complete when any of the objects in the collection have completed.

    Declaration
    public static async Task WhenAny(this IEnumerable<Task> tasks)
    Parameters
    Type Name Description
    IEnumerable<Task> tasks

    The tasks to wait on for completion.

    Returns
    Type Description
    Task

    A task that represents the completion of one of the supplied tasks.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps