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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.