Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.x: Fix toFuture marbles and descriptions #6200

Merged
merged 2 commits into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/main/java/io/reactivex/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5842,15 +5842,16 @@ public final T blockingSingle(T defaultItem) {
}

/**
* Returns a {@link Future} representing the single value emitted by this {@code Flowable}.
* 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.IllegalArgumentException}. If the {@link Flowable} is empty, {@link java.util.concurrent.Future}
* will receive a {@link java.util.NoSuchElementException}.
* {@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()}.
* <p>
* <img width="640" height="395" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/B.toFuture.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator consumes the source {@code Flowable} in an unbounded manner
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5340,15 +5340,16 @@ public final T blockingSingle(T defaultItem) {
}

/**
* Returns a {@link Future} representing the single value emitted by this {@code Observable}.
* Returns a {@link Future} representing the only value emitted by this {@code Observable}.
* <p>
* <img width="640" height="312" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/toFuture.o.png" alt="">
* <p>
* If the {@link Observable} emits more than one item, {@link java.util.concurrent.Future} will receive an
* {@link java.lang.IllegalArgumentException}. If the {@link Observable} is empty, {@link java.util.concurrent.Future}
* will receive an {@link java.util.NoSuchElementException}.
* {@link java.lang.IndexOutOfBoundsException}. If the {@link Observable} is empty, {@link java.util.concurrent.Future}
* will receive an {@link java.util.NoSuchElementException}. The {@code Observable} source has to terminate in order
* for the returned {@code Future} to terminate as well.
* <p>
* If the {@code Observable} may emit more than one item, use {@code Observable.toList().toFuture()}.
* <p>
* <img width="640" height="389" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/toFuture.o.png" alt="">
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code toFuture} does not operate by default on a particular {@link Scheduler}.</dd>
Expand Down