src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Flowable<R> flatMap(
            Function<? super T, ? extends Publisher<? extends R>> onNextMapper,
            Function<? super Throwable, ? extends Publisher<? extends R>> onErrorMapper,
            Callable<? extends Publisher<? extends R>> onCompleteSupplier) {
        ObjectHelper.requireNonNull(onNextMapper, "onNextMapper is null");
        ObjectHelper.requireNonNull(onErrorMapper, "onErrorMapper is null");
        ObjectHelper.requireNonNull(onCompleteSupplier, "onCompleteSupplier is null");
        return merge(new FlowableMapNotification<T, Publisher<? extends R>>(this, onNextMapper, onErrorMapper, onCompleteSupplier));
    }
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Flowable<R> flatMap(
            Function<? super T, ? extends Publisher<? extends R>> onNextMapper,
            Function<? super Throwable, ? extends Publisher<? extends R>> onErrorMapper,
            Callable<? extends Publisher<? extends R>> onCompleteSupplier) {
        ObjectHelper.requireNonNull(onNextMapper, "onNextMapper is null");
        ObjectHelper.requireNonNull(onErrorMapper, "onErrorMapper is null");
        ObjectHelper.requireNonNull(onCompleteSupplier, "onCompleteSupplier is null");
        return merge(new FlowableMapNotification<T, Publisher<? extends R>>(this, onNextMapper, onErrorMapper, onCompleteSupplier));
    }
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > flatMap ( Function < ? super T , ? extends Publisher < ? extends R > > onNextMapper , Function < ? super Throwable , ? extends Publisher < ? extends R > > onErrorMapper , Callable < ? extends Publisher < ? extends R > > onCompleteSupplier ) { ObjectHelper . requireNonNull ( onNextMapper , "onNextMapper is null" ) ; ObjectHelper . requireNonNull ( onErrorMapper , "onErrorMapper is null" ) ; ObjectHelper . requireNonNull ( onCompleteSupplier , "onCompleteSupplier is null" ) ; return merge ( new FlowableMapNotification < T , Publisher < ? extends R > > ( this , onNextMapper , onErrorMapper , onCompleteSupplier ) ) ; }
Returns a Flowable that applies a function to each item emitted or notification raised by the source
Publisher and then flattens the Publishers returned from these functions and emits the resulting items.
<p>
<img width="640" height="410" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMap.nce.png" alt="">
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator honors backpressure from downstream. The upstream Flowable is consumed
in a bounded manner (up to {@link #bufferSize()} outstanding request amount for items).
The inner {@code Publisher}s are expected to honor backpressure; if violated,
the operator <em>may</em> signal {@code MissingBackpressureException}.</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code flatMap} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <R>
the result type
@param onNextMapper
a function that returns a Publisher to merge for each item emitted by the source Publisher
@param onErrorMapper
a function that returns a Publisher to merge for an onError notification from the source
Publisher
@param onCompleteSupplier
a function that returns a Publisher to merge for an onComplete notification from the source
Publisher
@return a Flowable that emits the results of merging the Publishers returned from applying the
specified functions to the emissions and notifications of the source Publisher
@see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
Returns a Flowable that applies a function to each item emitted or notification raised by the source Publisher and then flattens the Publishers returned from these functions and emits the resulting items . <p > <img width = 640 height = 410 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / mergeMap . nce . png alt = > <dl > <dt > <b > Backpressure : < / b > < / dt > <dd > The operator honors backpressure from downstream . The upstream Flowable is consumed in a bounded manner ( up to { @link #bufferSize () } outstanding request amount for items ) . The inner { @code Publisher } s are expected to honor backpressure ; if violated the operator <em > may< / em > signal { @code MissingBackpressureException } . < / dd > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code flatMap } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >