Skip to content

3.x: Update marbles of amb(), ambArray() and ambWith() #7144

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

Merged
merged 2 commits into from
Jan 8, 2021
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
31 changes: 28 additions & 3 deletions src/main/java/io/reactivex/rxjava3/core/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,21 @@ public abstract class Flowable<@NonNull T> implements Publisher<T> {
* Mirrors the one {@link Publisher} in an {@link Iterable} of several {@code Publisher}s that first either emits an item or sends
* a termination notification.
* <p>
* <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.v3.png" alt="">
* <img width="640" height="417" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.amb.png" alt="">
* <p>
* When one of the {@code Publisher}s signal an item or terminates first, all subscriptions to the other
* {@code Publisher}s are canceled.
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator itself doesn't interfere with backpressure which is determined by the winning
* {@code Publisher}'s backpressure behavior.</dd>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>
* If any of the losing {@code Publisher}s signals an error, the error is routed to the global
* error handler via {@link RxJavaPlugins#onError(Throwable)}.
* </dd>
* </dl>
*
* @param <T> the common element type
Expand All @@ -193,13 +201,21 @@ public static <T> Flowable<T> amb(@NonNull Iterable<@NonNull ? extends Publisher
* Mirrors the one {@link Publisher} in an array of several {@code Publisher}s that first either emits an item or sends
* a termination notification.
* <p>
* <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.v3.png" alt="">
* <img width="640" height="417" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.ambArray.png" alt="">
* <p>
* When one of the {@code Publisher}s signal an item or terminates first, all subscriptions to the other
* {@code Publisher}s are canceled.
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator itself doesn't interfere with backpressure which is determined by the winning
* {@code Publisher}'s backpressure behavior.</dd>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code ambArray} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>
* If any of the losing {@code Publisher}s signals an error, the error is routed to the global
* error handler via {@link RxJavaPlugins#onError(Throwable)}.
* </dd>
* </dl>
*
* @param <T> the common element type
Expand Down Expand Up @@ -5927,13 +5943,22 @@ public final Single<Boolean> all(@NonNull Predicate<? super T> predicate) {
* Mirrors the {@link Publisher} (current or provided) that first either emits an item or sends a termination
* notification.
* <p>
* <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.v3.png" alt="">
* <img width="640" height="376" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.ambWith.png" alt="">
* <p>
* When the current {@code Flowable} signals an item or terminates first, the subscription to the other
* {@code Publisher} is canceled. If the other {@code Publisher} signals an item or terminates first,
* the subscription to the current {@code Flowable} is canceled.
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator itself doesn't interfere with backpressure which is determined by the winning
* {@code Publisher}'s backpressure behavior.</dd>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code ambWith} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>
* If the losing {@code Publisher} signals an error, the error is routed to the global
* error handler via {@link RxJavaPlugins#onError(Throwable)}.
* </dd>
* </dl>
*
* @param other
Expand Down
31 changes: 28 additions & 3 deletions src/main/java/io/reactivex/rxjava3/core/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,18 @@ public abstract class Observable<@NonNull T> implements ObservableSource<T> {
* Mirrors the one {@link ObservableSource} in an {@link Iterable} of several {@code ObservableSource}s that first either emits an item or sends
* a termination notification.
* <p>
* <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.v3.png" alt="">
* <img width="640" height="505" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Observable.amb.png" alt="">
* <p>
* When one of the {@code ObservableSource}s signal an item or terminates first, all subscriptions to the other
* {@code ObservableSource}s are disposed.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>
* If any of the losing {@code ObservableSource}s signals an error, the error is routed to the global
* error handler via {@link RxJavaPlugins#onError(Throwable)}.
* </dd>
* </dl>
*
* @param <T> the common element type
Expand All @@ -131,10 +139,18 @@ public static <T> Observable<T> amb(@NonNull Iterable<@NonNull ? extends Observa
* Mirrors the one {@link ObservableSource} in an array of several {@code ObservableSource}s that first either emits an item or sends
* a termination notification.
* <p>
* <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.v3.png" alt="">
* <img width="640" height="505" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Observable.ambArray.png" alt="">
* <p>
* When one of the {@code ObservableSource}s signal an item or terminates first, all subscriptions to the other
* {@code ObservableSource}s are disposed.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code ambArray} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>
* If any of the losing {@code ObservableSource}s signals an error, the error is routed to the global
* error handler via {@link RxJavaPlugins#onError(Throwable)}.
* </dd>
* </dl>
*
* @param <T> the common element type
Expand Down Expand Up @@ -5350,10 +5366,19 @@ public final Single<Boolean> all(@NonNull Predicate<? super T> predicate) {
* Mirrors the current {@code Observable} or the other {@link ObservableSource} provided of which the first either emits an item or sends a termination
* notification.
* <p>
* <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/ambWith.o.v3.png" alt="">
* <img width="640" height="448" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Observable.ambWith.png" alt="">
* <p>
* When the current {@code Observable} signals an item or terminates first, the subscription to the other
* {@code ObservableSource} is disposed. If the other {@code ObservableSource} signals an item or terminates first,
* the subscription to the current {@code Observable} is disposed.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code ambWith} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>
* If the losing {@code ObservableSource} signals an error, the error is routed to the global
* error handler via {@link RxJavaPlugins#onError(Throwable)}.
* </dd>
* </dl>
*
* @param other
Expand Down