Show / Hide Table of Contents

    Interface ITaskRunner

    Runner for running tasks.

    Namespace: ComponentTask
    Assembly: cs.temp.dll.dll
    Syntax
    public interface ITaskRunner

    Methods

    StartTask(Func<CancellationToken, Task>)

    Start a task on this runner. that is passed to the task-creator is cancelled when the runner is disposed, this can be usefull for cancelling external processes.

    Declaration
    Task StartTask(Func<CancellationToken, Task> taskCreator)
    Parameters
    Type Name Description
    System.Func<CancellationToken, System.Threading.Tasks.Task> taskCreator

    Function for creating the task.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Task that completes when the original task completes or when the runner gets disposed.

    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled. Can happen if you are awaiting a component that gets destroyed.

    StartTask(Func<Task>)

    Start a task on this runner.

    Declaration
    Task StartTask(Func<Task> taskCreator)
    Parameters
    Type Name Description
    System.Func<System.Threading.Tasks.Task> taskCreator

    Function for creating the task.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Task that completes when the original task completes or when the runner gets disposed.

    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled.

    StartTask<TIn>(Func<TIn, CancellationToken, Task>, TIn)

    Start a task on this runner. that is passed to the task-creator is cancelled when the runner is disposed, this can be usefull for cancelling external processes.

    Declaration
    Task StartTask<TIn>(Func<TIn, CancellationToken, Task> taskCreator, TIn data)
    Parameters
    Type Name Description
    System.Func<TIn, CancellationToken, System.Threading.Tasks.Task> taskCreator

    Function for creating the task.

    TIn data

    Data to pass into the taskCreator.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Task that completes when the original task completes or when the runner gets disposed.

    Type Parameters
    Name Description
    TIn

    Type of the data to pass into the taskCreator.

    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled. Can happen if you are awaiting a component that gets destroyed.

    StartTask<TIn>(Func<TIn, Task>, TIn)

    Start a task on this runner.

    Declaration
    Task StartTask<TIn>(Func<TIn, Task> taskCreator, TIn data)
    Parameters
    Type Name Description
    System.Func<TIn, System.Threading.Tasks.Task> taskCreator

    Function for creating the task.

    TIn data

    Data to pass into the taskCreator.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Task that completes when the original task completes or when the runner gets disposed.

    Type Parameters
    Name Description
    TIn

    Type of the data to pass into the taskCreator.

    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled.

    StartTask<TOut>(Func<CancellationToken, Task<TOut>>)

    Start a task on this runner. that is passed to the task-creator is cancelled when the runner is disposed, this can be usefull for cancelling external processes.

    Declaration
    Task<TOut> StartTask<TOut>(Func<CancellationToken, Task<TOut>> taskCreator)
    Parameters
    Type Name Description
    System.Func<CancellationToken, System.Threading.Tasks.Task<TOut>> taskCreator

    Function for creating the task.

    Returns
    Type Description
    System.Threading.Tasks.Task<TOut>

    Task that completes when the original task completes or when the runner gets disposed.

    Type Parameters
    Name Description
    TOut
    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled. Can happen if you are awaiting a component that gets destroyed.

    StartTask<TOut>(Func<Task<TOut>>)

    Start a task on this runner.

    Declaration
    Task<TOut> StartTask<TOut>(Func<Task<TOut>> taskCreator)
    Parameters
    Type Name Description
    System.Func<System.Threading.Tasks.Task<TOut>> taskCreator

    Function for creating the task.

    Returns
    Type Description
    System.Threading.Tasks.Task<TOut>

    Task that completes when the original task completes or when the runner gets disposed.

    Type Parameters
    Name Description
    TOut
    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled.

    StartTask<TIn, TOut>(Func<TIn, CancellationToken, Task<TOut>>, TIn)

    Start a task on this runner. that is passed to the task-creator is cancelled when the runner is disposed, this can be usefull for cancelling external processes.

    Declaration
    Task<TOut> StartTask<TIn, TOut>(Func<TIn, CancellationToken, Task<TOut>> taskCreator, TIn data)
    Parameters
    Type Name Description
    System.Func<TIn, CancellationToken, System.Threading.Tasks.Task<TOut>> taskCreator

    Function for creating the task.

    TIn data
    Returns
    Type Description
    System.Threading.Tasks.Task<TOut>

    Task that completes when the original task completes or when the runner gets disposed.

    Type Parameters
    Name Description
    TIn
    TOut
    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled. Can happen if you are awaiting a component that gets destroyed.

    StartTask<TIn, TOut>(Func<TIn, Task<TOut>>, TIn)

    Start a task on this runner.

    Declaration
    Task<TOut> StartTask<TIn, TOut>(Func<TIn, Task<TOut>> taskCreator, TIn data)
    Parameters
    Type Name Description
    System.Func<TIn, System.Threading.Tasks.Task<TOut>> taskCreator

    Function for creating the task.

    TIn data

    Data to pass into the taskCreator.

    Returns
    Type Description
    System.Threading.Tasks.Task<TOut>

    Task that completes when the original task completes or when the runner gets disposed.

    Type Parameters
    Name Description
    TIn

    Type of the data to pass into the taskCreator.

    TOut
    Exceptions
    Type Condition
    TaskCreatorReturnedNullException

    Thrown when null is returned from the 'taskCreator'.

    ComponentTaskCanceledException

    Thrown when awaiting a component-task that gets cancelled.

    Back to top ComponentTask documentation