As introduced in Chapter 1, Thinking Reactively, the Observable class 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 they finally arrive at a final Observer, which consumes them. We will present several ways of creating an Observable, but first, let's dive into how an Observable works through its onNext(), onCompleted(), and onError() calls.
The Observable
The workings of Observable
Before we do anything else, we need to study how an Observable sequentially passes items down the 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...