Thread Dispatcher


Pass the execution of a Delegate, Coroutine or Task from a background thread to the main thread, and await its completion or result on the calling thread as needed.


by John Baracuda


Price History +

Note: when updating Major versions of Thread Dispatcher from the Package Manager, don't forget to remove the old version from the project before importing the new one! :)


Thread Dispatcher is an open source tool to pass the execution of a Delegate, Coroutine or Task from a background thread to the main thread.


GitHub Repository & Documentation


Features:

• Dispatch the execution of an Action to the main thread.

• Dispatch the execution of a Func<TResult> to the main thread.

• Dispatch the execution of a Coroutine to the main thread.

• Dispatch the execution of a Task to the main thread.

• Dispatch the execution of a Task<TResult> to the main thread.

• Await the execution & result of a delegate or task on the calling thread.

• Await the start or the competion of a Coroutine on the calling thread.

• Asynchronous overloads have full cancellation support.

• Multiple extension methods to reduce boilder plate code.

• Full C# source code included.

• Uses UPM (Package can be imported via GitHub URL)


Donations accepted:

I spend a lot of time and effort working on this and other assets. If you like my work or feel generous, I would greatly appreciate a donation ♥