O'Reilly logo

C++ Reactive Programming by Peter Abraham, Praseed Pai

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Schedulers and error handling

We already covered the topic of scheduling in Chapter 8, RxCpp – the Key Elements. The schedulers in RxCpp queue up the values and deliver the queued up value using the supplied coordination. The coordination could be the current execution thread, the RxCpp run loop, the RxCpp event loop, or a new thread. The execution of scheduler operations can be achieved by using the RxCpp operators, such as observe_on() or subscribe_on(). These operators accept the chosen coordination as an argument. By default, the RxCpp library is single-threaded, so it does the scheduler operations. The user has to explicitly choose the thread in which execution happens:

//----------OnError_ObserveOn1.cpp #include "rxcpp/rx.hpp" #include ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required