src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Maybe<T> reduce(BiFunction<T, T, T> reducer) {
        ObjectHelper.requireNonNull(reducer, "reducer is null");
        return RxJavaPlugins.onAssembly(new FlowableReduceMaybe<T>(this, reducer));
    }
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Maybe<T> reduce(BiFunction<T, T, T> reducer) {
        ObjectHelper.requireNonNull(reducer, "reducer is null");
        return RxJavaPlugins.onAssembly(new FlowableReduceMaybe<T>(this, reducer));
    }
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Maybe < T > reduce ( BiFunction < T , T , T > reducer ) { ObjectHelper . requireNonNull ( reducer , "reducer is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableReduceMaybe < T > ( this , reducer ) ) ; }
Returns a Maybe that applies a specified accumulator function to the first item emitted by a source
Publisher, then feeds the result of that function along with the second item emitted by the source
Publisher into the same function, and so on until all items have been emitted by the finite source Publisher,
and emits the final result from the final call to your function as its sole item.
<p>
<img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/reduce.png" alt="">
<p>
This technique, which is called "reduce" here, is sometimes called "aggregate," "fold," "accumulate,"
"compress," or "inject" in other programming contexts. Groovy, for instance, has an {@code inject} method
that does a similar operation on lists.
<p>
Note that this operator requires the upstream to signal {@code onComplete} for the accumulator object to
be emitted. Sources that are infinite and never complete will never emit anything through this
operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator honors backpressure of its downstream consumer and consumes the
upstream source in unbounded mode.</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code reduce} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param reducer
an accumulator function to be invoked on each item emitted by the source Publisher, whose
result will be used in the next accumulator call
@return a Maybe that emits a single item that is the result of accumulating the items emitted by
the source Flowable
@see <a href="http://reactivex.io/documentation/operators/reduce.html">ReactiveX operators documentation: Reduce</a>
@see <a href="http://en.wikipedia.org/wiki/Fold_(higher-order_function)">Wikipedia: Fold (higher-order function)</a>
Returns a Maybe that applies a specified accumulator function to the first item emitted by a source Publisher then feeds the result of that function along with the second item emitted by the source Publisher into the same function and so on until all items have been emitted by the finite source Publisher and emits the final result from the final call to your function as its sole item . <p > <img width = 640 height = 320 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / reduce . png alt = > <p > This technique which is called reduce here is sometimes called aggregate fold accumulate compress or inject in other programming contexts . Groovy for instance has an { @code inject } method that does a similar operation on lists . <p > Note that this operator requires the upstream to signal { @code onComplete } for the accumulator object to be emitted . Sources that are infinite and never complete will never emit anything through this operator and an infinite source may lead to a fatal { @code OutOfMemoryError } . <dl > <dt > <b > Backpressure : < / b > < / dt > <dd > The operator honors backpressure of its downstream consumer and consumes the upstream source in unbounded mode . < / dd > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code reduce } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >