JoinableTaskFactory.RunAsync(Of T) Method (Func(Of Task(Of T)))

 

Wraps the invocation of an asynchronous method so that it may execute asynchronously, but may potentially be synchronously completed (waited on) in the future.

Namespace:   Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

Public Function RunAsync(Of T) (
	asyncMethod As Func(Of Task(Of T))
) As JoinableTask(Of T)

Parameters

asyncMethod
Type: System.Func(Of Task(Of T))

The asynchronous operation.

Return Value

Type: Microsoft.VisualStudio.Threading.JoinableTask(Of T)

An object that tracks the completion of the asynchronous operation, and allows for later synchronous blocking of the main thread for completion if necessary.

Type Parameters

T

The type of value returned by the asynchronous operation.

Exceptions thrown by the delegate are captured by the returned JoinableTask.

Return to top
Show: