O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hot and Cold Observables

Quite often, in the literature and documentation terms, Hot and Cold Observables can be found.

Cold Observables are the most common Observable type. For example, one can be created with the following code:

Observable.just("First item", "Second item")        .subscribe();

Cold Observable means that the items won't be emitted by the Observable until there is a Subscriber. This means that before the .subscribe() element is called, no items will be produced and thus none of the items that are intended to be omitted will be missed; everything will be processed.

A Hot Observable is an Observable that will begin producing (emitting) items internally as soon as it is created. For example, in the later chapters we will see that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required