You might have noticed that all of the reactive abstractions that you have encountered in this book have a few things in common. For one, they work as container-like abstractions, which can be described as follows:
- Futures encapsulate a computation that eventually yields a single value
- Observables encapsulate computations that can yield multiple values over time, in the shape of a stream
- Channels encapsulate the values pushed to them, and they can have the values being popped from the channel, working as a concurrent queue through which concurrent processes can communicate
Once we have a container, we can operate on it in a number of ways, which are very similar across the different abstractions and frameworks. We can filter the values contained in them; transform them by using map; combine abstractions of the same type by using bind...