Skip to content

Commit

Permalink
2.x: make Obs.combineLatest consistent with Flowable + doc cornercase (
Browse files Browse the repository at this point in the history
…#4987)

* 2.x: make Obs.combineLatest consistent with Flowable + doc cornercase

* early termination to cancel the other sources
  • Loading branch information
akarnokd authored Jan 12, 2017
1 parent 3768a53 commit d1cd153
Show file tree
Hide file tree
Showing 6 changed files with 449 additions and 4 deletions.
76 changes: 76 additions & 0 deletions src/main/java/io/reactivex/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public static int bufferSize() {
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -180,6 +184,10 @@ public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources,
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -217,6 +225,10 @@ public static <T, R> Flowable<R> combineLatest(Function<? super Object[], ? exte
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -262,6 +274,10 @@ public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources,
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -300,6 +316,10 @@ public static <T, R> Flowable<R> combineLatest(Iterable<? extends Publisher<? ex
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -343,6 +363,10 @@ public static <T, R> Flowable<R> combineLatest(Iterable<? extends Publisher<? ex
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -382,6 +406,10 @@ public static <T, R> Flowable<R> combineLatestDelayError(Publisher<? extends T>[
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -421,6 +449,10 @@ public static <T, R> Flowable<R> combineLatestDelayError(Function<? super Object
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -462,6 +494,10 @@ public static <T, R> Flowable<R> combineLatestDelayError(Function<? super Object
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -509,6 +545,10 @@ public static <T, R> Flowable<R> combineLatestDelayError(Publisher<? extends T>[
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -548,6 +588,10 @@ public static <T, R> Flowable<R> combineLatestDelayError(Iterable<? extends Publ
* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the
* implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a
* {@code Function<Integer[], R>} passed to the method would trigger a {@code ClassCastException}.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
*
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -588,6 +632,10 @@ public static <T, R> Flowable<R> combineLatestDelayError(Iterable<? extends Publ
* source Publishers each time an item is received from either of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -629,6 +677,10 @@ public static <T1, T2, R> Flowable<R> combineLatest(
* source Publishers each time an item is received from any of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -674,6 +726,10 @@ public static <T1, T2, T3, R> Flowable<R> combineLatest(
* source Publishers each time an item is received from any of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -723,6 +779,10 @@ public static <T1, T2, T3, T4, R> Flowable<R> combineLatest(
* source Publishers each time an item is received from any of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -777,6 +837,10 @@ public static <T1, T2, T3, T4, T5, R> Flowable<R> combineLatest(
* source Publishers each time an item is received from any of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -835,6 +899,10 @@ public static <T1, T2, T3, T4, T5, T6, R> Flowable<R> combineLatest(
* source Publishers each time an item is received from any of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -898,6 +966,10 @@ public static <T1, T2, T3, T4, T5, T6, T7, R> Flowable<R> combineLatest(
* source Publishers each time an item is received from any of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down Expand Up @@ -965,6 +1037,10 @@ public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Flowable<R> combineLatest(
* source Publishers each time an item is received from any of the source Publishers, where this
* aggregation is defined by a specified function.
* <p>
* If any of the sources never produces an item but only terminates (normally or with an error), the
* resulting sequence terminates immediately (normally or with all the errors accumulated till that point).
* If that input source is also synchronous, other sources after it will not be subscribed to.
* <p>
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
Expand Down
Loading

0 comments on commit d1cd153

Please sign in to comment.