Chapter 10. Working with Rx concurrency and synchronization

 

This chapter covers

  • Rx schedulers
  • Time-based operators
  • Synchronization in the observable pipeline

Timing is everything, or at least that’s what some say. Unlike collections (enumerables), timing plays a big part in the observables world. The time between notifications can be long or short, and it can affect how you process them. In chapter 9, you saw examples of buffering elements or creating sliding windows over time. There’s also the matter of where the execution takes place (for example, threads, tasks, dispatchers, and so on). The concepts of time and execution context are related and provide the foundation for the Rx concurrency model. The scheduler type and its derivations express this model. This chapter explains the scheduler’s layer in Rx and how to use it to control concurrency inside the Rx observable pipeline, as well as how to use it with Rx time-based operators.

10.1. Controlling concurrency with schedulers

10.2. Using time-based operators

10.3. Synchronizing the observable emissions

10.4. Summary