src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Flowable<T> switchOnNextDelayError(Publisher<? extends Publisher<? extends T>> sources, int prefetch) {
        return fromPublisher(sources).switchMapDelayError(Functions.<Publisher<? extends T>>identity(), prefetch);
    }
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Flowable<T> switchOnNextDelayError(Publisher<? extends Publisher<? extends T>> sources, int prefetch) {
        return fromPublisher(sources).switchMapDelayError(Functions.<Publisher<? extends T>>identity(), prefetch);
    }
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > switchOnNextDelayError ( Publisher < ? extends Publisher < ? extends T > > sources , int prefetch ) { return fromPublisher ( sources ) . switchMapDelayError ( Functions . < Publisher < ? extends T > > identity ( ) , prefetch ) ; }
Converts a Publisher that emits Publishers into a Publisher that emits the items emitted by the
most recently emitted of those Publishers and delays any exception until all Publishers terminate.
<p>
<img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchDo.png" alt="">
<p>
{@code switchOnNext} subscribes to a Publisher that emits Publishers. Each time it observes one of
these emitted Publishers, the Publisher returned by {@code switchOnNext} begins emitting the items
emitted by that Publisher. When a new Publisher is emitted, {@code switchOnNext} stops emitting items
from the earlier-emitted Publisher and begins emitting items from the new one.
<p>
The resulting Publisher completes if both the main Publisher and the last inner Publisher, if any, complete.
If the main Publisher signals an onError, the termination of the last inner Publisher will emit that error as is
or wrapped into a CompositeException along with the other possible errors the former inner Publishers signaled.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator honors backpressure from downstream. The outer {@code Publisher} is consumed in an
unbounded manner (i.e., without backpressure) and the inner {@code Publisher}s are expected to honor
backpressure but it is not enforced; the operator won't signal a {@code MissingBackpressureException}
but the violation <em>may</em> lead to {@code OutOfMemoryError} due to internal buffer bloat.</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code switchOnNextDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <T> the item type
@param sources
the source Publisher that emits Publishers
@param prefetch
the number of items to prefetch from the inner Publishers
@return a Flowable that emits the items emitted by the Publisher most recently emitted by the source
Publisher
@see <a href="http://reactivex.io/documentation/operators/switch.html">ReactiveX operators documentation: Switch</a>
@since 2.0
Converts a Publisher that emits Publishers into a Publisher that emits the items emitted by the most recently emitted of those Publishers and delays any exception until all Publishers terminate . <p > <img width = 640 height = 370 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / switchDo . png alt = > <p > { @code switchOnNext } subscribes to a Publisher that emits Publishers . Each time it observes one of these emitted Publishers the Publisher returned by { @code switchOnNext } begins emitting the items emitted by that Publisher . When a new Publisher is emitted { @code switchOnNext } stops emitting items from the earlier - emitted Publisher and begins emitting items from the new one . <p > The resulting Publisher completes if both the main Publisher and the last inner Publisher if any complete . If the main Publisher signals an onError the termination of the last inner Publisher will emit that error as is or wrapped into a CompositeException along with the other possible errors the former inner Publishers signaled . <dl > <dt > <b > Backpressure : < / b > < / dt > <dd > The operator honors backpressure from downstream . The outer { @code Publisher } is consumed in an unbounded manner ( i . e . without backpressure ) and the inner { @code Publisher } s are expected to honor backpressure but it is not enforced ; the operator won t signal a { @code MissingBackpressureException } but the violation <em > may< / em > lead to { @code OutOfMemoryError } due to internal buffer bloat . < / dd > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code switchOnNextDelayError } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >