AsyncBridge
A Helper class to run Asynchronous functions from synchronous ones
Runs a task with the "Fire and Forget" pattern using Task.Run,
and unwraps and handles exceptions
A function that returns the task to run
Error handling action, null by default
Creates a new AsyncBridge. This should always be used in
conjunction with the using statement, to ensure it is disposed
A class to bridge synchronous asynchronous methods
Constructs the AsyncBridge by capturing the current
SynchronizationContext and replacing it with a new
ExclusiveSynchronizationContext.
Execute's an async task with a void return type
from a synchronous context
Task to execute
Optional callback
Execute's an async task with a T return type
from a synchronous context
The type of the task
Task to execute
Optional callback
Execute's an async task with a T return type
from a synchronous context
The type of the task
Task to execute
The callback function that uses the result of the task
Disposes the object