The previous chapters covered asynchronous programming principles, the difference between CPU operations and I/O operations, and how to create observables. Chapter 2, Asynchronous Programming in Python, detailed the two patterns that allow us to handle concurrency, and which is most adapted to which use case. Unfortunately real life, and so coding, is rarely Boolean; sometimes an asynchronous application also has to deal with CPU-intensive operations, or even worse, blocking code. This chapter details how ReactiveX allows us to handle such situations, with tools that are easy to use and efficient, such as schedulers. The first part of this chapter is a reminder of the concurrency issues that can happen, and how schedulers can solve these issues. The second part details the schedulers available in RxPY, and when and how to use them.
The following...