Show / Hide Table of Contents

Class Continuation

Represents various continuations.

Inheritance
Object
Continuation
Namespace: DotNext.Threading.Tasks
Assembly: DotNext.dll
Syntax
public static class Continuation : object

Methods

| Improve this Doc View Source

OnCanceled<T, C>(Task<T>, TaskScheduler)

Returns constant value if underlying task is canceled.

Declaration
public static Task<T> OnCanceled<T, C>(this Task<T> task, TaskScheduler scheduler = null)

    where C : Constant<T>, new()
Parameters
Type Name Description
Task<T> task

The task to check.

TaskScheduler scheduler

Optional scheduler used to schedule continuation.

Returns
Type Description
Task<T>

The task representing continuation.

Type Parameters
Name Description
T

The type of task result.

C

The type describing constant value.

Remarks

This continuation doesn't produce memory pressure. The delegate representing continuation is cached for future reuse as well as constant value.

| Improve this Doc View Source

OnCompleted(Task)

Allows to obtain original in its final state after await without throwing exception produced by this task.

Declaration
public static Task<Task> OnCompleted(this Task task)
Parameters
Type Name Description
Task task

The task to await.

Returns
Type Description
Task<Task>

task in final state.

| Improve this Doc View Source

OnCompleted<R>(Task<R>)

Allows to obtain original in its final state after await without throwing exception produced by this task.

Declaration
public static Task<Task<R>> OnCompleted<R>(this Task<R> task)
Parameters
Type Name Description
Task<R> task

The task to await.

Returns
Type Description
Task<Task<R>>

task in final state.

Type Parameters
Name Description
R

The type of the task result.

| Improve this Doc View Source

OnFaulted<T, C>(Task<T>, TaskScheduler)

Returns constant value if underlying task is failed.

Declaration
public static Task<T> OnFaulted<T, C>(this Task<T> task, TaskScheduler scheduler = null)

    where C : Constant<T>, new()
Parameters
Type Name Description
Task<T> task

The task to check.

TaskScheduler scheduler

Optional scheduler used to schedule continuation.

Returns
Type Description
Task<T>

The task representing continuation.

Type Parameters
Name Description
T

The type of task result.

C

The type describing constant value.

Remarks

This continuation doesn't produce memory pressure. The delegate representing continuation is cached for future reuse as well as constant value.

| Improve this Doc View Source

OnFaultedOrCanceled<T, C>(Task<T>, TaskScheduler)

Returns constant value if underlying task is failed or canceled.

Declaration
public static Task<T> OnFaultedOrCanceled<T, C>(this Task<T> task, TaskScheduler scheduler = null)

    where C : Constant<T>, new()
Parameters
Type Name Description
Task<T> task

The task to check.

TaskScheduler scheduler

Optional scheduler used to schedule continuation.

Returns
Type Description
Task<T>

The task representing continuation.

Type Parameters
Name Description
T

The type of task result.

C

The type describing constant value.

Remarks

This continuation doesn't produce memory pressure. The delegate representing continuation is cached for future reuse as well as constant value.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX