@@ -1648,9 +1648,80 @@ public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? ext
1648
1648
return fromPublisher(sources).concatMapDelayError((Function)Functions.identity(), tillTheEnd, prefetch);
1649
1649
}
1650
1650
1651
+ /**
1652
+ * Concatenates a sequence of {@link Publisher}s eagerly into a single stream of values.
1653
+
1654
+ *
1655
+
1656
+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1657
+ * source {@code Publisher}s. The operator buffers the values emitted by these {@code Publisher}s and then drains them
1658
+ * in order, each one after the previous one completes.
1659
+
1660
+ *
Backpressure:
1661
+ *
Backpressure is honored towards the downstream and the inner {@code Publisher}s are
1662
+ * expected to support backpressure. Violating this assumption, the operator will
1663
+ * signal {@link MissingBackpressureException}.
1664
+ *
Scheduler:
1665
+ *
This method does not operate by default on a particular {@link Scheduler}.
1666
+ *
1667
+ * @param the value type
1668
+ * @param sources a sequence of {@code Publisher}s that need to be eagerly concatenated
1669
+ * @return the new {@code Flowable} instance with the specified concatenation behavior
1670
+ * @throws NullPointerException if {@code sources} is {@code null}
1671
+ * @since 2.0
1672
+ */
1673
+ @CheckReturnValue
1674
+ @BackpressureSupport(BackpressureKind.FULL)
1675
+ @SchedulerSupport(SchedulerSupport.NONE)
1676
+ @NonNull
1677
+ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) {
1678
+ return concatEager(sources, bufferSize(), bufferSize());
1679
+ }
1680
+
1681
+ /**
1682
+ * Concatenates a sequence of {@link Publisher}s eagerly into a single stream of values and
1683
+ * runs a limited number of inner sequences at once.
1684
+
1685
+ *
1686
+
1687
+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1688
+ * source {@code Publisher}s. The operator buffers the values emitted by these {@code Publisher}s and then drains them
1689
+ * in order, each one after the previous one completes.
1690
+
1691
+ *
Backpressure:
1692
+ *
Backpressure is honored towards the downstream and both the outer and inner {@code Publisher}s are
1693
+ * expected to support backpressure. Violating this assumption, the operator will
1694
+ * signal {@link MissingBackpressureException}.
1695
+ *
Scheduler:
1696
+ *
This method does not operate by default on a particular {@link Scheduler}.
1697
+ *
1698
+ * @param the value type
1699
+ * @param sources a sequence of {@code Publisher}s that need to be eagerly concatenated
1700
+ * @param maxConcurrency the maximum number of concurrently running inner {@code Publisher}s; {@link Integer#MAX_VALUE}
1701
+ * is interpreted as all inner {@code Publisher}s can be active at the same time
1702
+ * @param prefetch the number of elements to prefetch from each inner {@code Publisher} source
1703
+ * @return the new {@code Flowable} instance with the specified concatenation behavior
1704
+ * @throws NullPointerException if {@code sources} is {@code null}
1705
+ * @throws IllegalArgumentException if {@code maxConcurrency} or {@code prefetch} is non-positive
1706
+ * @since 2.0
1707
+ */
1708
+ @CheckReturnValue
1709
+ @NonNull
1710
+ @BackpressureSupport(BackpressureKind.FULL)
1711
+ @SchedulerSupport(SchedulerSupport.NONE)
1712
+ @SuppressWarnings({ "rawtypes", "unchecked" })
1713
+ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) {
1714
+ Objects.requireNonNull(sources, "sources is null");
1715
+ ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
1716
+ ObjectHelper.verifyPositive(prefetch, "prefetch");
1717
+ return RxJavaPlugins.onAssembly(new FlowableConcatMapEager(new FlowableFromIterable(sources), Functions.identity(), maxConcurrency, prefetch, ErrorMode.BOUNDARY));
1718
+ }
1719
+
1651
1720
/**
1652
1721
* Concatenates a {@link Publisher} sequence of {@code Publisher}s eagerly into a single stream of values.
1653
1722
1723
+ *
1724
+
1654
1725
* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1655
1726
* emitted source {@code Publisher}s as they are observed. The operator buffers the values emitted by these
1656
1727
* {@code Publisher}s and then drains them in order, each one after the previous one completes.
@@ -1677,7 +1748,10 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends
1677
1748
}
1678
1749
1679
1750
/**
1680
- * Concatenates a {@link Publisher} sequence of {@code Publisher}s eagerly into a single stream of values.
1751
+ * Concatenates a {@link Publisher} sequence of {@code Publisher}s eagerly into a single stream of values and
1752
+ * runs a limited number of inner sequences at once.
1753
+
1754
+ *
1681
1755
1682
1756
* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1683
1757
* emitted source {@code Publisher}s as they are observed. The operator buffers the values emitted by these
@@ -1713,7 +1787,10 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends
1713
1787
}
1714
1788
1715
1789
/**
1716
- * Concatenates a sequence of {@link Publisher}s eagerly into a single stream of values.
1790
+ * Concatenates a sequence of {@link Publisher}s eagerly into a single stream of values,
1791
+ * delaying errors until all the inner sequences terminate.
1792
+
1793
+ *
1717
1794
1718
1795
* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1719
1796
* source {@code Publisher}s. The operator buffers the values emitted by these {@code Publisher}s and then drains them
@@ -1730,18 +1807,22 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends
1730
1807
* @param sources a sequence of {@code Publisher}s that need to be eagerly concatenated
1731
1808
* @return the new {@code Flowable} instance with the specified concatenation behavior
1732
1809
* @throws NullPointerException if {@code sources} is {@code null}
1733
- * @since 2 .0
1810
+ * @since 3.0 .0
1734
1811
*/
1735
1812
@CheckReturnValue
1736
1813
@BackpressureSupport(BackpressureKind.FULL)
1737
1814
@SchedulerSupport(SchedulerSupport.NONE)
1738
1815
@NonNull
1739
- public static Flowable concatEager (@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) {
1740
- return concatEager (sources, bufferSize(), bufferSize());
1816
+ public static Flowable concatEagerDelayError (@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) {
1817
+ return concatEagerDelayError (sources, bufferSize(), bufferSize());
1741
1818
}
1742
1819
1743
1820
/**
1744
- * Concatenates a sequence of {@link Publisher}s eagerly into a single stream of values.
1821
+ * Concatenates a sequence of {@link Publisher}s eagerly into a single stream of values,
1822
+ * delaying errors until all the inner sequences terminate and runs a limited number
1823
+ * of inner sequences at once.
1824
+
1825
+ *
1745
1826
1746
1827
* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1747
1828
* source {@code Publisher}s. The operator buffers the values emitted by these {@code Publisher}s and then drains them
@@ -1762,18 +1843,89 @@ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends P
1762
1843
* @return the new {@code Flowable} instance with the specified concatenation behavior
1763
1844
* @throws NullPointerException if {@code sources} is {@code null}
1764
1845
* @throws IllegalArgumentException if {@code maxConcurrency} or {@code prefetch} is non-positive
1765
- * @since 2 .0
1846
+ * @since 3.0 .0
1766
1847
*/
1767
1848
@CheckReturnValue
1768
1849
@NonNull
1769
1850
@BackpressureSupport(BackpressureKind.FULL)
1770
1851
@SchedulerSupport(SchedulerSupport.NONE)
1771
1852
@SuppressWarnings({ "rawtypes", "unchecked" })
1772
- public static Flowable concatEager (@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) {
1853
+ public static Flowable concatEagerDelayError (@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) {
1773
1854
Objects.requireNonNull(sources, "sources is null");
1774
1855
ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
1775
1856
ObjectHelper.verifyPositive(prefetch, "prefetch");
1776
- return RxJavaPlugins.onAssembly(new FlowableConcatMapEager(new FlowableFromIterable(sources), Functions.identity(), maxConcurrency, prefetch, ErrorMode.IMMEDIATE));
1857
+ return RxJavaPlugins.onAssembly(new FlowableConcatMapEager(new FlowableFromIterable(sources), Functions.identity(), maxConcurrency, prefetch, ErrorMode.END));
1858
+ }
1859
+
1860
+ /**
1861
+ * Concatenates a {@link Publisher} sequence of {@code Publisher}s eagerly into a single stream of values,
1862
+ * delaying errors until all the inner and the outer sequences terminate.
1863
+
1864
+ *
1865
+
1866
+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1867
+ * emitted source {@code Publisher}s as they are observed. The operator buffers the values emitted by these
1868
+ * {@code Publisher}s and then drains them in order, each one after the previous one completes.
1869
+
1870
+ *
Backpressure:
1871
+ *
Backpressure is honored towards the downstream and both the outer and inner {@code Publisher}s are
1872
+ * expected to support backpressure. Violating this assumption, the operator will
1873
+ * signal {@link MissingBackpressureException}.
1874
+ *
Scheduler:
1875
+ *
This method does not operate by default on a particular {@link Scheduler}.
1876
+ *
1877
+ * @param the value type
1878
+ * @param sources a sequence of {@code Publisher}s that need to be eagerly concatenated
1879
+ * @return the new {@code Flowable} instance with the specified concatenation behavior
1880
+ * @throws NullPointerException if {@code sources} is {@code null}
1881
+ * @since 3.0.0
1882
+ */
1883
+ @CheckReturnValue
1884
+ @BackpressureSupport(BackpressureKind.FULL)
1885
+ @SchedulerSupport(SchedulerSupport.NONE)
1886
+ @NonNull
1887
+ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) {
1888
+ return concatEagerDelayError(sources, bufferSize(), bufferSize());
1889
+ }
1890
+
1891
+ /**
1892
+ * Concatenates a {@link Publisher} sequence of {@code Publisher}s eagerly into a single stream of values,
1893
+ * delaying errors until all the inner and outer sequences terminate and runs a limited number of inner
1894
+ * sequences at once.
1895
+
1896
+ *
1897
+
1898
+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
1899
+ * emitted source {@code Publisher}s as they are observed. The operator buffers the values emitted by these
1900
+ * {@code Publisher}s and then drains them in order, each one after the previous one completes.
1901
+
1902
+ *
Backpressure:
1903
+ *
Backpressure is honored towards the downstream and both the outer and inner {@code Publisher}s are
1904
+ * expected to support backpressure. Violating this assumption, the operator will
1905
+ * signal {@link MissingBackpressureException}.
1906
+ *
Scheduler:
1907
+ *
This method does not operate by default on a particular {@link Scheduler}.
1908
+ *
1909
+ * @param the value type
1910
+ * @param sources a sequence of {@code Publisher}s that need to be eagerly concatenated
1911
+ * @param maxConcurrency the maximum number of concurrently running inner {@code Publisher}s; {@link Integer#MAX_VALUE}
1912
+ * is interpreted as all inner {@code Publisher}s can be active at the same time
1913
+ * @param prefetch the number of elements to prefetch from each inner {@code Publisher} source
1914
+ * @return the new {@code Flowable} instance with the specified concatenation behavior
1915
+ * @throws NullPointerException if {@code sources} is {@code null}
1916
+ * @throws IllegalArgumentException if {@code maxConcurrency} or {@code prefetch} is non-positive
1917
+ * @since 3.0.0
1918
+ */
1919
+ @CheckReturnValue
1920
+ @NonNull
1921
+ @BackpressureSupport(BackpressureKind.FULL)
1922
+ @SchedulerSupport(SchedulerSupport.NONE)
1923
+ @SuppressWarnings({ "rawtypes", "unchecked" })
1924
+ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) {
1925
+ Objects.requireNonNull(sources, "sources is null");
1926
+ ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
1927
+ ObjectHelper.verifyPositive(prefetch, "prefetch");
1928
+ return RxJavaPlugins.onAssembly(new FlowableConcatMapEagerPublisher(sources, Functions.identity(), maxConcurrency, prefetch, ErrorMode.END));
1777
1929
}
1778
1930
1779
1931
/**
@@ -10134,6 +10286,7 @@ public final Flowable flatMap(@NonNull Function super T, ? extends Publ
10134
10286
* if {@code false}, the first one signaling an exception will terminate the whole sequence immediately
10135
10287
* @return the new {@code Flowable} instance
10136
10288
* @throws NullPointerException if {@code mapper} is {@code null}
10289
+ * @throws IllegalArgumentException if {@code maxConcurrency} is non-positive
10137
10290
10138
10291
* @since 2.0
10139
10292
*/
0 commit comments