Class TaskExtensions
Provides extension methods for
Inherited Members
Namespace: Swan
Syntax
public static class TaskExtensions
Methods
Await(Task)
Suspends execution until the specified
This method operates similarly to the await C# operator, but is meant to be called from a non-async method.
Declaration
public static void Await(this Task this)
Parameters
Type | Name | Description |
---|---|---|
Task | this | The |
Await(Task, Boolean)
Suspends execution until the specified
This method operates similarly to the await C# operator, but is meant to be called from a non-async method.
Declaration
public static void Await(this Task this, bool continueOnCapturedContext)
Parameters
Type | Name | Description |
---|---|---|
Task | this | The |
Boolean | continueOnCapturedContext | If set to true,
attempts to marshal the continuation back to the original context captured.
This parameter has the same effect as calling the |
Await<TResult>(Task<TResult>)
Suspends execution until the specified
This method operates similarly to the await C# operator, but is meant to be called from a non-async method.
Declaration
public static TResult Await<TResult>(this Task<TResult> this)
Parameters
Type | Name | Description |
---|---|---|
Task<TResult> | this | The |
Returns
Type | Description |
---|---|
TResult | The result of |
Type Parameters
Name | Description |
---|---|
TResult | The type of the task's result. |
Await<TResult>(Task<TResult>, Boolean)
Suspends execution until the specified
This method operates similarly to the await C# operator, but is meant to be called from a non-async method.
Declaration
public static TResult Await<TResult>(this Task<TResult> this, bool continueOnCapturedContext)
Parameters
Type | Name | Description |
---|---|---|
Task<TResult> | this | The |
Boolean | continueOnCapturedContext | If set to true,
attempts to marshal the continuation back to the original context captured.
This parameter has the same effect as calling the |
Returns
Type | Description |
---|---|
TResult | The result of |
Type Parameters
Name | Description |
---|---|
TResult | The type of the task's result. |