Compartir a través de


VsTaskLibraryHelper.GetAwaiter Method

Definition

Overloads

GetAwaiter(VsTaskRunContext)
Obsolete.

Allows awaiting on a VsTaskRunContext in order to execute code at a particular priority on or off the UI thread.

GetAwaiter(VsTaskAwaiter)

Extension method to add await support for VsTaskAwaiter instance which can be returned from ResumeWith call.

We simply return the same awaiter instance.

GetAwaiter(IVsTask)

Extension method for IVsTask to support await syntax in managed code.

GetAwaiter(VsTaskRunContext)

Caution

Awaiting VsTaskRunContext can introduce deadlocks on shutdown. Use the StartOnIdle or WithPriority extension methods on JoinableTaskFactory instead.

Allows awaiting on a VsTaskRunContext in order to execute code at a particular priority on or off the UI thread.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Threading::AwaitExtensions::TaskSchedulerAwaiter GetAwaiter(Microsoft::VisualStudio::Shell::VsTaskRunContext context);
public static Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter GetAwaiter (this Microsoft.VisualStudio.Shell.VsTaskRunContext context);
[System.Obsolete("Awaiting VsTaskRunContext can introduce deadlocks on shutdown. Use the StartOnIdle or WithPriority extension methods on JoinableTaskFactory instead.")]
public static Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter GetAwaiter (this Microsoft.VisualStudio.Shell.VsTaskRunContext context);
static member GetAwaiter : Microsoft.VisualStudio.Shell.VsTaskRunContext -> Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter
[<System.Obsolete("Awaiting VsTaskRunContext can introduce deadlocks on shutdown. Use the StartOnIdle or WithPriority extension methods on JoinableTaskFactory instead.")>]
static member GetAwaiter : Microsoft.VisualStudio.Shell.VsTaskRunContext -> Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter
<Extension()>
Public Function GetAwaiter (context As VsTaskRunContext) As AwaitExtensions.TaskSchedulerAwaiter

Parameters

context
VsTaskRunContext

The context to run the next segment from the calling async method with.

Returns

An awaiter that will cause the caller to switch to a particular TaskScheduler.

Attributes

Applies to

GetAwaiter(VsTaskAwaiter)

Extension method to add await support for VsTaskAwaiter instance which can be returned from ResumeWith call.

We simply return the same awaiter instance.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Internal::VisualStudio::Shell::VsTaskAwaiter ^ GetAwaiter(Microsoft::Internal::VisualStudio::Shell::VsTaskAwaiter ^ awaiter);
public static Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter GetAwaiter (this Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter awaiter);
static member GetAwaiter : Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter -> Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter
<Extension()>
Public Function GetAwaiter (awaiter As VsTaskAwaiter) As VsTaskAwaiter

Parameters

awaiter
Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter

[in] Awaiter that contains the task that will be used to schedule continuations.

Returns

Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter

Returns the same instance of awaiter that this method was called on.

Remarks

This method returns the same awaiter as the one provided in the awaiter parameter.

Applies to

GetAwaiter(IVsTask)

Extension method for IVsTask to support await syntax in managed code.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Internal::VisualStudio::Shell::VsTaskAwaiter ^ GetAwaiter(Microsoft::VisualStudio::Shell::Interop::IVsTask ^ task);
public static Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter GetAwaiter (this Microsoft.VisualStudio.Shell.Interop.IVsTask task);
static member GetAwaiter : Microsoft.VisualStudio.Shell.Interop.IVsTask -> Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter
<Extension()>
Public Function GetAwaiter (task As IVsTask) As VsTaskAwaiter

Parameters

task
IVsTask

IVsTask instance to be used for scheduling continuations.

Returns

Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter

an awaitable object for IVsTask instance.

Applies to