src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U, V> Observable<Observable<T>> window(
            ObservableSource<U> openingIndicator,
            Function<? super U, ? extends ObservableSource<V>> closingIndicator) {
        return window(openingIndicator, closingIndicator, bufferSize());
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U, V> Observable<Observable<T>> window(
            ObservableSource<U> openingIndicator,
            Function<? super U, ? extends ObservableSource<V>> closingIndicator) {
        return window(openingIndicator, closingIndicator, bufferSize());
    }
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , V > Observable < Observable < T > > window ( ObservableSource < U > openingIndicator , Function < ? super U , ? extends ObservableSource < V > > closingIndicator ) { return window ( openingIndicator , closingIndicator , bufferSize ( ) ) ; }
Returns an Observable that emits windows of items it collects from the source ObservableSource. The resulting
ObservableSource emits windows that contain those items emitted by the source ObservableSource between the time when
the {@code openingIndicator} ObservableSource emits an item and when the ObservableSource returned by
{@code closingIndicator} emits an item.
<p>
<img width="640" height="550" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window2.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>This version of {@code window} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <U> the element type of the window-opening ObservableSource
@param <V> the element type of the window-closing ObservableSources
@param openingIndicator
an ObservableSource that, when it emits an item, causes another window to be created
@param closingIndicator
a {@link Function} that produces an ObservableSource for every window created. When this ObservableSource
emits an item, the associated window is closed and emitted
@return an Observable that emits windows of items emitted by the source ObservableSource that are governed by
the specified window-governing ObservableSources
@see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
Returns an Observable that emits windows of items it collects from the source ObservableSource . The resulting ObservableSource emits windows that contain those items emitted by the source ObservableSource between the time when the { @code openingIndicator } ObservableSource emits an item and when the ObservableSource returned by { @code closingIndicator } emits an item . <p > <img width = 640 height = 550 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window2 . png alt = > <dl > <dt > <b > Scheduler : < / b > < / dt > <dd > This version of { @code window } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >