As introduced in Chapter 1, Thinking Reactively, the Observable is a push-based, composable iterator. For a given Observable<T>, it pushes items (called emissions) of type T through a series of operators until it finally arrives at a final Observer, which consumes the items. We will cover several ways to create an Observable, but first, let's dive into how an Observable works through its onNext(), onCompleted(), and onError() calls.
The Observable
How Observables work
Before we do anything else, we need to study how an Observable sequentially passes items down a chain to an Observer. At the highest level, an Observable works by passing three types of events:
- onNext(): This passes each item one at a time from the...