Fork me on GitHub

Async Worker

The Async Worker is used for execution of asynchronous operations. It is based on the BackgroundWorker of the .net library but simplifies usage from within code (BackgroundWorker is built to be used within the designer of views).

The AsyncWorker provides automatic switching back to the thread where the operation was started. Please note that this works only if the thread from which the operation was started is associated with a thread synchronizer capable of thread switching. This is true for example in the user interface thread.

Therefore the AsyncWorker is best used to execute operations from the user interface without blocking it and with the possibility to update the user interface on completion of the operation or to report progress.

Finally, the AsyncWorker improves the BackgroundWorker so that when an operation throws an exception then it is not swallowed.