Class TaskExtensions
Extension methods for the System.Threading.Tasks.Task.
Inheritance
Namespace: Cuemon.Threading.Tasks
Assembly: Cuemon.Core.dll
Syntax
public static class TaskExtensions
Methods
| Improve this DocContinueWithCapturedContext(Task)
Configures an awaiter to marshal the continuation back to the captured synchronization context.
Declaration
public static ConfiguredTaskAwaitable ContinueWithCapturedContext(this Task t)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task | t | The System.Threading.Tasks.Task to extend. |
Returns
Type | Description |
---|---|
System.Runtime.CompilerServices.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.
Declaration
public static ConfiguredTaskAwaitable<TResult> ContinueWithCapturedContext<TResult>(this Task<TResult> t)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task<TResult> | t | The System.Threading.Tasks.Task to extend. |
Returns
Type | Description |
---|---|
System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult> | An object used to await this task. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public static ConfiguredTaskAwaitable ContinueWithSuppressedContext(this Task t)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task | t | The System.Threading.Tasks.Task to extend. |
Returns
Type | Description |
---|---|
System.Runtime.CompilerServices.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.
Declaration
public static ConfiguredTaskAwaitable<TResult> ContinueWithSuppressedContext<TResult>(this Task<TResult> t)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task<TResult> | t | The System.Threading.Tasks.Task to extend. |
Returns
Type | Description |
---|---|
System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult> | An object used to await this task. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result produced by this System.Threading.Tasks.Task<TResult>. |