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 ...

Get C++ Reactive Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.