1717
1818import org.reactivestreams.*;
1919
20+ import io.reactivex.Observable;
2021import io.reactivex.annotations.*;
2122import io.reactivex.disposables.Disposable;
2223import io.reactivex.exceptions.Exceptions;
@@ -1415,7 +1416,9 @@ public static <T> Flowable<T> concatArrayDelayError(Publisher<? extends T>... so
14151416 }
14161417
14171418 /**
1418- * Concatenates a sequence of Publishers eagerly into a single stream of values.
1419+ * Concatenates an array of Publishers eagerly into a single stream of values.
1420+ * <p>
1421+ * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.concatArrayEager.png" alt="">
14191422 * <p>
14201423 * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
14211424 * source Publishers. The operator buffers the values emitted by these Publishers and then drains them
@@ -1430,7 +1433,7 @@ public static <T> Flowable<T> concatArrayDelayError(Publisher<? extends T>... so
14301433 * <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
14311434 * </dl>
14321435 * @param <T> the value type
1433- * @param sources a sequence of Publishers that need to be eagerly concatenated
1436+ * @param sources an array of Publishers that need to be eagerly concatenated
14341437 * @return the new Publisher instance with the specified concatenation behavior
14351438 * @since 2.0
14361439 */
@@ -1442,7 +1445,9 @@ public static <T> Flowable<T> concatArrayEager(Publisher<? extends T>... sources
14421445 }
14431446
14441447 /**
1445- * Concatenates a sequence of Publishers eagerly into a single stream of values.
1448+ * Concatenates an array of Publishers eagerly into a single stream of values.
1449+ * <p>
1450+ * <img width="640" height="406" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.concatArrayEager.nn.png" alt="">
14461451 * <p>
14471452 * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
14481453 * source Publishers. The operator buffers the values emitted by these Publishers and then drains them
@@ -1457,7 +1462,7 @@ public static <T> Flowable<T> concatArrayEager(Publisher<? extends T>... sources
14571462 * <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
14581463 * </dl>
14591464 * @param <T> the value type
1460- * @param sources a sequence of Publishers that need to be eagerly concatenated
1465+ * @param sources an array of Publishers that need to be eagerly concatenated
14611466 * @param maxConcurrency the maximum number of concurrent subscriptions at a time, Integer.MAX_VALUE
14621467 * is interpreted as an indication to subscribe to all sources at once
14631468 * @param prefetch the number of elements to prefetch from each Publisher source
@@ -1475,6 +1480,70 @@ public static <T> Flowable<T> concatArrayEager(int maxConcurrency, int prefetch,
14751480 return RxJavaPlugins.onAssembly(new FlowableConcatMapEager(new FlowableFromArray(sources), Functions.identity(), maxConcurrency, prefetch, ErrorMode.IMMEDIATE));
14761481 }
14771482
1483+ /**
1484+ * Concatenates an array of {@link Publisher}s eagerly into a single stream of values
1485+ * and delaying any errors until all sources terminate.
1486+ * <p>
1487+ * <img width="640" height="358" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.concatArrayEagerDelayError.png" alt="">
1488+ * <p>
1489+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1490+ * source {@code Publisher}s. The operator buffers the values emitted by these {@code Publisher}s
1491+ * and then drains them in order, each one after the previous one completes.
1492+ * <dl>
1493+ * <dt><b>Backpressure:</b></dt>
1494+ * <dd>The operator honors backpressure from downstream. The {@code Publisher}
1495+ * sources are expected to honor backpressure as well.
1496+ * If any of the source {@code Publisher}s violate this, the operator will signal a
1497+ * {@code MissingBackpressureException}.</dd>
1498+ * <dt><b>Scheduler:</b></dt>
1499+ * <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
1500+ * </dl>
1501+ * @param <T> the value type
1502+ * @param sources an array of {@code Publisher}s that need to be eagerly concatenated
1503+ * @return the new Flowable instance with the specified concatenation behavior
1504+ * @since 2.2.1 - experimental
1505+ */
1506+ @CheckReturnValue
1507+ @SchedulerSupport(SchedulerSupport.NONE)
1508+ @BackpressureSupport(BackpressureKind.FULL)
1509+ public static <T> Flowable<T> concatArrayEagerDelayError(Publisher<? extends T>... sources) {
1510+ return concatArrayEagerDelayError(bufferSize(), bufferSize(), sources);
1511+ }
1512+
1513+ /**
1514+ * Concatenates an array of {@link Publisher}s eagerly into a single stream of values
1515+ * and delaying any errors until all sources terminate.
1516+ * <p>
1517+ * <img width="640" height="359" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.concatArrayEagerDelayError.nn.png" alt="">
1518+ * <p>
1519+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1520+ * source {@code Publisher}s. The operator buffers the values emitted by these {@code Publisher}s
1521+ * and then drains them in order, each one after the previous one completes.
1522+ * <dl>
1523+ * <dt><b>Backpressure:</b></dt>
1524+ * <dd>The operator honors backpressure from downstream. The {@code Publisher}
1525+ * sources are expected to honor backpressure as well.
1526+ * If any of the source {@code Publisher}s violate this, the operator will signal a
1527+ * {@code MissingBackpressureException}.</dd>
1528+ * <dt><b>Scheduler:</b></dt>
1529+ * <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
1530+ * </dl>
1531+ * @param <T> the value type
1532+ * @param sources an array of {@code Publisher}s that need to be eagerly concatenated
1533+ * @param maxConcurrency the maximum number of concurrent subscriptions at a time, Integer.MAX_VALUE
1534+ * is interpreted as indication to subscribe to all sources at once
1535+ * @param prefetch the number of elements to prefetch from each {@code Publisher} source
1536+ * @return the new Flowable instance with the specified concatenation behavior
1537+ * @since 2.2.1 - experimental
1538+ */
1539+ @SuppressWarnings({ "rawtypes", "unchecked" })
1540+ @CheckReturnValue
1541+ @SchedulerSupport(SchedulerSupport.NONE)
1542+ @BackpressureSupport(BackpressureKind.FULL)
1543+ public static <T> Flowable<T> concatArrayEagerDelayError(int maxConcurrency, int prefetch, Publisher<? extends T>... sources) {
1544+ return fromArray(sources).concatMapEagerDelayError((Function)Functions.identity(), maxConcurrency, prefetch, true);
1545+ }
1546+
14781547 /**
14791548 * Concatenates the Iterable sequence of Publishers into a single sequence by subscribing to each Publisher,
14801549 * one after the other, one at a time and delays any errors till the all inner Publishers terminate.
0 commit comments