Table of Contents

Class TaskExtensions

Namespace
Cuemon.Extensions.Threading.Tasks
Assembly
Cuemon.Extensions.Threading.dll

Extension methods for the System.Threading.Tasks.Task class.

public static class TaskExtensions
Inheritance
Object
TaskExtensions

Methods

ContinueWithCapturedContext(Task)

Configures an awaiter to marshal the continuation back to the captured synchronization context.

public static ConfiguredTaskAwaitable ContinueWithCapturedContext(this Task task)

Parameters

task Task

The System.Threading.Tasks.Task to extend.

Returns

ConfiguredTaskAwaitable

An object used to await this task.

ContinueWithCapturedContext<TResult>(Task<TResult>)

Configures an awaiter to marshal the continuation back to the captured synchronization context.

public static ConfiguredTaskAwaitable<TResult> ContinueWithCapturedContext<TResult>(this Task<TResult> task)

Parameters

task Task<TResult>

The System.Threading.Tasks.Task to extend.

Returns

ConfiguredTaskAwaitable<TResult>

An object used to await this task.

Type Parameters

TResult

The type of the result produced by this System.Threading.Tasks.Task<TResult>.

ContinueWithSuppressedContext(Task)

Configures an awaiter to suppress capturing a synchronization context back to the continuation.

public static ConfiguredTaskAwaitable ContinueWithSuppressedContext(this Task task)

Parameters

task Task

The System.Threading.Tasks.Task to extend.

Returns

ConfiguredTaskAwaitable

An object used to await this task.

ContinueWithSuppressedContext<TResult>(Task<TResult>)

Configures an awaiter to suppress capturing a synchronization context back to the continuation.

public static ConfiguredTaskAwaitable<TResult> ContinueWithSuppressedContext<TResult>(this Task<TResult> task)

Parameters

task Task<TResult>

The System.Threading.Tasks.Task to extend.

Returns

ConfiguredTaskAwaitable<TResult>

An object used to await this task.

Type Parameters

TResult

The type of the result produced by this System.Threading.Tasks.Task<TResult>.