Observable

See also Observable site

The Observable class (note that this is not the java.util.Observable class that comes with the JDK) is the mathematical dual of the Iterator class, which basically means that they are like the two sides of the same coin. It has an underlying collection or computation that produces values that can be consumed by a consumer. But the difference is that the consumer doesn't "pull" these values from the producer like in the Iterator pattern. It is exactly the opposite; the producer 'pushes' the values as notifications to the consumer. (Tsvetinov - 2015 - Learning reactive programming with Java 8 …, p. 7, context: RxJava)

Connecting Observables, Observers, and Subjects, p. 31

p. 43 All of the factory methods we've been using in this chapter return cold Observables. Cold Observables produce notifications on demand, and for every Subscriber, they produce independent notifications.

> There are Observable instances which, when they start emitting notifications, it doesn't matter if there are subscriptions to them or not. They continue emitting them until completion. All the subscribers receive the same notifications, and by default, when a Subscriber subscribes, it doesn't receive the notifications emitted before that. These are hot Observable instances.

## Hot and Cold Observables We can say that cold Observables generate notifications for each subscriber and hot Observables are always running, broadcasting notifications to all of their subscribers. Think of a hot Observable as a radio station. All of the listeners that are listening to it at this moment listen to the same song. A cold Observable is a music CD. Many people can buy it and listen to it independently.