src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Future<T> toFuture() {
        return subscribeWith(new FutureSubscriber<T>());
    }
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Future<T> toFuture() {
        return subscribeWith(new FutureSubscriber<T>());
    }
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Future < T > toFuture ( ) { return subscribeWith ( new FutureSubscriber < T > ( ) ) ; }
Returns a {@link Future} representing the only value emitted by this {@code Flowable}.
<p>
<img width="640" height="324" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/Flowable.toFuture.png" alt="">
<p>
If the {@link Flowable} emits more than one item, {@link java.util.concurrent.Future} will receive an
{@link java.lang.IndexOutOfBoundsException}. If the {@link Flowable} is empty, {@link java.util.concurrent.Future}
will receive a {@link java.util.NoSuchElementException}. The {@code Flowable} source has to terminate in order
for the returned {@code Future} to terminate as well.
<p>
If the {@code Flowable} may emit more than one item, use {@code Flowable.toList().toFuture()}.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator consumes the source {@code Flowable} in an unbounded manner
(i.e., no backpressure applied to it).</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code toFuture} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@return a {@link Future} that expects a single item to be emitted by this {@code Flowable}
@see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX documentation: To</a>
Returns a { @link Future } representing the only value emitted by this { @code Flowable } . <p > <img width = 640 height = 324 src = https : // github . com / ReactiveX / RxJava / wiki / images / rx - operators / Flowable . toFuture . png alt = > <p > If the { @link Flowable } emits more than one item { @link java . util . concurrent . Future } will receive an { @link java . lang . IndexOutOfBoundsException } . If the { @link Flowable } is empty { @link java . util . concurrent . Future } will receive a { @link java . util . NoSuchElementException } . The { @code Flowable } source has to terminate in order for the returned { @code Future } to terminate as well . <p > If the { @code Flowable } may emit more than one item use { @code Flowable . toList () . toFuture () } . <dl > <dt > <b > Backpressure : < / b > < / dt > <dd > The operator consumes the source { @code Flowable } in an unbounded manner ( i . e . no backpressure applied to it ) . < / dd > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code toFuture } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >