Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Let ReactiveUI RxApp handle multiple windows #2092
On UWP each new window gets its own ui thread and the way
This can cause issues with RxApp.MainThreadScheduler, where each one of these windows runs its own dispatcher thread and is an “Application Single Threaded Apartment” (ASTA). Essentially the framework is blocking what it thinks is a potential deadlock. This particular exception is thrown when code running under one STA (1) calls out to another STA (2) and that STA (2) might have to re-enter STA (1) in order to do its work. The framework throws that exception at this point to try and stop you getting into a mess with deadlocks.
I am currently testing a scheduler that can handle multiple windows/dispatchers and will hopefully manage this as well, but we are still testing it and I'm not sure if I'll be able to block this exception yet (which would make my new scheduler useless...