The window() operator is almost identical to the buffer() operator, except that it buffers into another Observable rather than a collection. This results in an Observable<Observable<T>> that emits observables. Each Observable emission caches emissions for each scope and then flushes them once subscribed (much like the GroupedObservable from groupBy(), which we worked with in Chapter 4, Combining Observables). This allows emissions to be worked with immediately as they become available, rather than waiting for each list or collection to be finalized and emitted. The window() operator is also convenient to work with if you want to use operators to transform each batch.
Just like buffer(), you can limit each batch using fixed sizing, a time interval, or a boundary from another Observable.