Multicasting also allows us to cache values that are shared across multiple Observers. This may sound surprising, but when you think about it long enough, you may realize this makes sense. If we are sharing data across multiple Observers, it makes sense that any caching feature would be shared across Observers too. Replaying and caching data is a multicasting activity, and we will explore how to do it safely and efficiently with RxJava.
Replaying and caching
Replaying
The replay() operator is a powerful way to hold onto previous emissions within a certain scope and re-emit them when a new Observer comes in. It will return a ConnectableObservable that will both multicast emissions as well as emit previous emissions...