This project is read-only.

How to observe on main/ui thread?

Dec 21, 2014 at 11:02 AM

I'm trying to have a worker thread publish to an observable observing on the ui thread. I see in the MFC time flies sample that you would do it like so:
auto mainFormScheduler = std::make_shared<rxcpp::win32::WindowScheduler>();
Seems that v2 changed. I'm confused on to what scheduler I should choose, I tried capturing rxcpp::rxsc::make_current_thread() while in the main thread. That seems like a sentinel value for using the thread that is publishing values.

rxcpp::observe_on_event_loop() looks promising, but it observes on a worker thread. This is what I have:
        .subscribe([this](std::tuple<wstring, cell_list> tu)
        _set_auto_complete_text(std::get<0>(tu), std::get<1>(tu));

        .subscribe([this](wstring s)
            std::make_tuple(s, cl));
Any help appreciated. Thank you.
Dec 21, 2014 at 8:11 PM
Thanks for the question!

Yes, v2 has not ported the win32 and winrt adapters from v1 yet.

It should not be too hard to port the WindowScheduler. Contributions are welcome! Otherwise, I do not know when that work would be picked up.
Dec 21, 2014 at 8:14 PM
For tracking, I opened an issue on github (github is the source-of-truth now)