17
17
18
18
import org.reactivestreams.*;
19
19
20
+ import io.reactivex.Observable;
20
21
import io.reactivex.annotations.*;
21
22
import io.reactivex.disposables.Disposable;
22
23
import io.reactivex.exceptions.Exceptions;
@@ -1415,7 +1416,9 @@ public static <T> Flowable<T> concatArrayDelayError(Publisher<? extends T>... so
1415
1416
}
1416
1417
1417
1418
/**
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="">
1419
1422
* <p>
1420
1423
* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1421
1424
* 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
1430
1433
* <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
1431
1434
* </dl>
1432
1435
* @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
1434
1437
* @return the new Publisher instance with the specified concatenation behavior
1435
1438
* @since 2.0
1436
1439
*/
@@ -1442,7 +1445,9 @@ public static <T> Flowable<T> concatArrayEager(Publisher<? extends T>... sources
1442
1445
}
1443
1446
1444
1447
/**
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="">
1446
1451
* <p>
1447
1452
* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1448
1453
* 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
1457
1462
* <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
1458
1463
* </dl>
1459
1464
* @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
1461
1466
* @param maxConcurrency the maximum number of concurrent subscriptions at a time, Integer.MAX_VALUE
1462
1467
* is interpreted as an indication to subscribe to all sources at once
1463
1468
* @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,
1475
1480
return RxJavaPlugins.onAssembly(new FlowableConcatMapEager(new FlowableFromArray(sources), Functions.identity(), maxConcurrency, prefetch, ErrorMode.IMMEDIATE));
1476
1481
}
1477
1482
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
+
1478
1547
/**
1479
1548
* Concatenates the Iterable sequence of Publishers into a single sequence by subscribing to each Publisher,
1480
1549
* one after the other, one at a time and delays any errors till the all inner Publishers terminate.
0 commit comments