Share via


AwaitExtensions.SwitchTo(TaskScheduler, Boolean) Method

Definition

Gets an awaitable that schedules continuations on the specified scheduler.

public static Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaitable SwitchTo (this System.Threading.Tasks.TaskScheduler scheduler, bool alwaysYield = false);
static member SwitchTo : System.Threading.Tasks.TaskScheduler * bool -> Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaitable
<Extension()>
Public Function SwitchTo (scheduler As TaskScheduler, Optional alwaysYield As Boolean = false) As AwaitExtensions.TaskSchedulerAwaitable

Parameters

scheduler
TaskScheduler

The task scheduler used to execute continuations.

alwaysYield
Boolean

A value indicating whether the caller should yield even if already executing on the desired task scheduler.

Returns

An awaitable.

Applies to