In the previous chapter, we were introduced to the RxCpp library and its programming model. We wrote some programs to understand workings of the library and also covered the most essential elements of the RxCpp library. In this chapter, we will cover, in some depth, the key elements of reactive programming , which includes the following:
- Observables
- Observers and their variants (Subscribers)
- Subjects
- Schedulers
- Operators
In effect, the key aspects of reactive programming are as follows:
- Observables are Streams to which Observers can subscribe for notifications
- A Subject is a combination of Observable and Observer
- Schedulers execute the Action associated with Operators and help the flow of data from Observables to Observers
- Operators are functions that take an Observable and emit another Observable (well, almost!)