This document serves at an attempt to reverse engineer, study, and simplify the usage and creation of Avalonia.Threading.Dispatcher
. The goal of the document is to try to rewrite Avalonia.Threading.Dispatcher
in such a way that it is not hardlinked to a UI Thread. This will expand its usability in other applications (like PowerShell threads) and allow the end user to associate a dispatcher with any thread they want.
My plan is to have the code used in avalonia eventually reimplemented as an extension to the System.Threading.Thread
class. For now, I am mostly interested in reimplementing their dispatcher in PowerShell Core as an alternative to System.Windows.Threading.Dispatcher
. That class is WPF-only and currently there is no fully cross-platform reimplementation of that class.
Avalonia is pretty close, but, again, it is hard associated with a UI and its thread; all I need to do is break that hard association.