Class AsyncContext
Simplifies the setup of a SynchronizationContext for the use of async calls in the current thread.
Inheritance
System.Object
AsyncContext
Namespace:Microsoft.SqlTools.ServiceLayer.Utility
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public static class AsyncContext
Methods
| Improve this Doc View SourceStart(Func<Task>)
Starts a new ThreadSynchronizationContext, attaches it to the thread, and then runs the given async main function.
Declaration
public static void Start(Func<Task> asyncMainFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task> | asyncMainFunc | The Task-returning Func which represents the "main" function for the thread. |