@@ -6278,7 +6278,7 @@ public final Observable<T> retry(Func2<Integer, Throwable, Boolean> predicate) {
6278
6278
* System.out.println("subscribing");
6279
6279
* s.onError(new RuntimeException("always fails"));
6280
6280
* }).retryWhen(attempts -> {
6281
- * return attempts.zip (Observable.range(1, 3), (n, i) -> i).flatMap(i -> {
6281
+ * return attempts.zipWith (Observable.range(1, 3), (n, i) -> i).flatMap(i -> {
6282
6282
* System.out.println("delay retry by " + i + " second(s)");
6283
6283
* return Observable.timer(i, TimeUnit.SECONDS);
6284
6284
* });
@@ -8971,10 +8971,38 @@ public final <T2, R> Observable<R> zip(Iterable<? extends T2> other, Func2<? sup
8971
8971
* and emits the results of {@code zipFunction} applied to these pairs
8972
8972
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#zip">RxJava wiki: zip</a>
8973
8973
* @see <a href="http://msdn.microsoft.com/en-us/library/system.reactive.linq.observable.zip.aspx">MSDN: Observable.Zip</a>
8974
+ * @deprecated Use zipWith instead. Changed to match naming convention of mergeWith, concatWith, etc
8974
8975
*/
8976
+ @ Deprecated
8975
8977
public final <T2 , R > Observable <R > zip (Observable <? extends T2 > other , Func2 <? super T , ? super T2 , ? extends R > zipFunction ) {
8976
8978
return zip (this , other , zipFunction );
8977
8979
}
8980
+
8981
+ /**
8982
+ * Returns an Observable that emits items that are the result of applying a specified function to pairs of
8983
+ * values, one each from the source Observable and another specified Observable.
8984
+ * <p>
8985
+ * <img width="640" height="380" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/zip.png" alt="">
8986
+ * <p>
8987
+ * {@code zip} does not operate by default on a particular {@link Scheduler}.
8988
+ *
8989
+ * @param <T2>
8990
+ * the type of items emitted by the {@code other} Observable
8991
+ * @param <R>
8992
+ * the type of items emitted by the resulting Observable
8993
+ * @param other
8994
+ * the other Observable
8995
+ * @param zipFunction
8996
+ * a function that combines the pairs of items from the two Observables to generate the items to
8997
+ * be emitted by the resulting Observable
8998
+ * @return an Observable that pairs up values from the source Observable and the {@code other} Observable
8999
+ * and emits the results of {@code zipFunction} applied to these pairs
9000
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#zip">RxJava wiki: zip</a>
9001
+ * @see <a href="http://msdn.microsoft.com/en-us/library/system.reactive.linq.observable.zip.aspx">MSDN: Observable.Zip</a>
9002
+ */
9003
+ public final <T2 , R > Observable <R > zipWith (Observable <? extends T2 > other , Func2 <? super T , ? super T2 , ? extends R > zipFunction ) {
9004
+ return zip (this , other , zipFunction );
9005
+ }
8978
9006
8979
9007
/**
8980
9008
* An Observable that never sends any information to an {@link Observer}.
0 commit comments