ThreadHelper.InvokeAsync Method (Action, Func(Of Boolean))

 

Makes the RPC call to invoke the action like Invoke method but on the background thread. Since it is on the background thread, it doesn't block until the RPC call is served. If the RPC call fails, it retries until the onRpcCallFailed returns true. This method is also different from the BeginInvoke method, which uses the UI thread dispatcher, and it may not be in a state to process the request immediately (for example, it can be in a pumping wait).

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

Public Function InvokeAsync (
	executeAction As Action,
	onRpcCallFailed As Func(Of Boolean)
) As Task

Parameters

executeAction
Type: System.Action

The action to execute.

onRpcCallFailed
Type: System.Func(Of Boolean)

The function to execute if the RPC call failed. This function can return true to stop retying. It can be null if the invoker should keep retrying.

Return Value

Type: System.Threading.Tasks.Task

The task.

Return to top
Show: