Sync background thread to main thread in .NET Core console app? #1778
-
Trying various combinations of these schedulers with the code below to achieve switching of synchronization context like it's described in the article. Class the will send notifications from background thread
Create background threads and start sending notifications
I would like to see the same thread ID at the moment of subscription and observation.
Unfortunately, the observation thread is different from the main subscription thread.
Is it possible to somehow always receive notifications in the main thread even though |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Working with a console app is a bit different than a GUI app in this regard. It doesn't have an event loop for Rx to work with. A solution shared here uses an EventLoopScheduler to fill in as a "main thread." Maybe that will work for your use case? |
Beta Was this translation helpful? Give feedback.
Working with a console app is a bit different than a GUI app in this regard. It doesn't have an event loop for Rx to work with. A solution shared here uses an EventLoopScheduler to fill in as a "main thread." Maybe that will work for your use case?