June 2018
Intermediate to advanced
348 pages
8h 45m
English
The ObserveOn and SubscribeOn operators behave in a different manner, and this has been a source of confusion for reactive programming newbies. The ObserveOn operator changes the thread of the Operators and Observers below it. In the case of SubscribeOn, it affects Operators and methods that are above and below it as well. The following program demonstrates subtle changes in the runtime behavior of a program, caused by the way the SubscribeOn and ObserveOn operators behave. Let's write a program that uses the ObserveOn operator:
//-------- ObservableOnScheduler.cpp #include "rxcpp/rx.hpp" int main(){ //------- Print the main thread id printf("Main Thread Id is %dn", std::this_thread::get_id()); //-------- We ...Read now
Unlock full access