-
Notifications
You must be signed in to change notification settings - Fork 6
MainThreadDispatcher API
supermax edited this page Jun 28, 2020
·
1 revision
Main Thread dispatcher is responsible for the synchronisation of callbacks between Main and other threads.
public interface IThreadDispatcher
{
// managed Thread ID
int ThreadId { get; }
// dispatch - adds callback delegate into dispatcher’s queue
// action - delegate reference to method that should be invoked on main thread
// payload - the data that should be passed to the method/callback
void Dispatch(Delegate action, object[] payload);
}
MainThreadDispatcher.Default.Dispatch(Callback, new object[] { payload, state });