TplExtensions.NoThrowAwaitable(Task, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns an awaitable for the specified task that will never throw, even if the source task faults or is canceled.
public static Microsoft.VisualStudio.Threading.TplExtensions.NoThrowTaskAwaitable NoThrowAwaitable (this System.Threading.Tasks.Task task, bool captureContext = true);
static member NoThrowAwaitable : System.Threading.Tasks.Task * bool -> Microsoft.VisualStudio.Threading.TplExtensions.NoThrowTaskAwaitable
<Extension()>
Public Function NoThrowAwaitable (task As Task, Optional captureContext As Boolean = true) As TplExtensions.NoThrowTaskAwaitable
Parameters
- task
- Task
The task whose completion should signal the completion of the returned awaitable.
- captureContext
- Boolean
if set to true
the continuation will be scheduled on the caller's context; false
to always execute the continuation on the threadpool.
Returns
An awaitable.