src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.NONE)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Disposable forEachWhile(final Predicate<? super T> onNext, final 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");

        ForEachWhileSubscriber<T> s = new ForEachWhileSubscriber<T>(onNext, onError, onComplete);
        subscribe(s);
        return s;
    }
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.NONE)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Disposable forEachWhile(final Predicate<? super T> onNext, final 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");

        ForEachWhileSubscriber<T> s = new ForEachWhileSubscriber<T>(onNext, onError, onComplete);
        subscribe(s);
        return s;
    }
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . NONE ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable forEachWhile ( final Predicate < ? super T > onNext , final 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" ) ; ForEachWhileSubscriber < T > s = new ForEachWhileSubscriber < T > ( onNext , onError , onComplete ) ; subscribe ( s ) ; return s ; }
Subscribes to the {@link Publisher} and receives notifications for each element and the terminal events until the
onNext Predicate returns false.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator consumes the source {@code Publisher} in an unbounded manner (i.e., no
backpressure is applied to it).</dd>
<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 signaled.
@return
a {@link Disposable} that allows canceling 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>
Subscribes to the { @link Publisher } and receives notifications for each element and the terminal events until the onNext Predicate returns false . <dl > <dt > <b > Backpressure : < / b > < / dt > <dd > The operator consumes the source { @code Publisher } in an unbounded manner ( i . e . no backpressure is applied to it ) . < / dd > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code forEachWhile } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >