src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Disposable forEachWhile(final Predicate<? super T> onNext, Consumer<? super Throwable> onError,
            final Action onComplete) {
        ObjectHelper.requireNonNull(onNext, "onNext is null");
        ObjectHelper.requireNonNull(onError, "onError is null");
        ObjectHelper.requireNonNull(onComplete, "onComplete is null");

        ForEachWhileObserver<T> o = new ForEachWhileObserver<T>(onNext, onError, onComplete);
        subscribe(o);
        return o;
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Disposable forEachWhile(final Predicate<? super T> onNext, Consumer<? super Throwable> onError,
            final Action onComplete) {
        ObjectHelper.requireNonNull(onNext, "onNext is null");
        ObjectHelper.requireNonNull(onError, "onError is null");
        ObjectHelper.requireNonNull(onComplete, "onComplete is null");

        ForEachWhileObserver<T> o = new ForEachWhileObserver<T>(onNext, onError, onComplete);
        subscribe(o);
        return o;
    }
Subscribes to the {@link ObservableSource} and receives notifications for each element and the terminal events until the
onNext Predicate returns false.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code forEachWhile} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param onNext
{@link Predicate} to execute for each item.
@param onError
{@link Consumer} to execute when an error is emitted.
@param onComplete
{@link Action} to execute when completion is signalled.
@return
a Disposable that allows disposing of an asynchronous sequence
@throws NullPointerException
if {@code onNext} is null, or
if {@code onError} is null, or
if {@code onComplete} is null
@see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>