VsTaskLibraryHelper.Yield Method

Definition

Overloads

Yield(VsTaskRunContext, IVsTaskCompletionSource)

Yields the current operation on the thread, the rest of the async method will be scheduled as a continuation.

Yield(IVsTaskSchedulerService, VsTaskRunContext, IVsTaskCompletionSource)

Yields the current operation on the thread, the rest of the async method will be scheduled as a continuation.

Yield(VsTaskRunContext, IVsTaskCompletionSource)

Yields the current operation on the thread, the rest of the async method will be scheduled as a continuation.

C#
public static Microsoft.Internal.VisualStudio.Shell.YieldAwaiter Yield(Microsoft.VisualStudio.Shell.VsTaskRunContext context = Microsoft.VisualStudio.Shell.VsTaskRunContext.CurrentContext, Microsoft.VisualStudio.Shell.Interop.IVsTaskCompletionSource taskCompletionSource = default);

Parameters

context
VsTaskRunContext

Context to use for scheduling the rest of the async method.

taskCompletionSource
IVsTaskCompletionSource

If a task completion source is passed in, the task created will be added as a dependency.

Returns

Microsoft.Internal.VisualStudio.Shell.YieldAwaiter

an awaiter implementation to use with await keyword.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

Yield(IVsTaskSchedulerService, VsTaskRunContext, IVsTaskCompletionSource)

Yields the current operation on the thread, the rest of the async method will be scheduled as a continuation.

C#
public static Microsoft.Internal.VisualStudio.Shell.YieldAwaiter Yield(this Microsoft.VisualStudio.Shell.Interop.IVsTaskSchedulerService scheduler, Microsoft.VisualStudio.Shell.VsTaskRunContext context = Microsoft.VisualStudio.Shell.VsTaskRunContext.CurrentContext, Microsoft.VisualStudio.Shell.Interop.IVsTaskCompletionSource taskCompletionSource = default);

Parameters

scheduler
IVsTaskSchedulerService

Task scheduler service instance.

context
VsTaskRunContext

Context to use for scheduling the rest of the async method.

taskCompletionSource
IVsTaskCompletionSource

If a task completion source is passed in, the task created will be added as a dependency.

Returns

Microsoft.Internal.VisualStudio.Shell.YieldAwaiter

an awaiter implementation to use with await keyword.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022