tetsurom/rxqt

UI thread schedulers?

Closed this issue · 2 comments

Hi!

Is there any plans to write a custom scheduler for the UI thread?

Thank you for the good point!

I had no such idea, but it seemed good.
So I have added a simple interface rxqt_run_loop::observe_on_run_loop().

You can use this as;

QApplication app(argc, argv);
rxqt::run_loop rxqt_run_loop;

rxcpp::observable<>::range(1)
    .subscribe_on(rx::observe_on_event_loop())
    .take(1)
    .observe_on(rxqt_run_loop.observe_on_run_loop())
    .subscribe(…);

See also:
https://github.com/tetsurom/rxqt/blob/94886b646f7c81dba68e9c40bd24b990dcea8a8a/sample/thread/main.cpp

Sounds great! Thank you for that!