From bc1c705e5b0966c70aae18a40b9c5f6b328bf1a1 Mon Sep 17 00:00:00 2001 From: David Karnok Date: Sat, 6 Jan 2018 15:19:14 +0100 Subject: [PATCH] 2.x: add error handling section to merge() operator docs (#5786) * 2.x: add error handling section to merge() operator docs * Change to "UndeliverableException errors" --- src/main/java/io/reactivex/Completable.java | 59 ++++++++- src/main/java/io/reactivex/Flowable.java | 128 +++++++++++++++++- src/main/java/io/reactivex/Maybe.java | 104 +++++++++++++++ src/main/java/io/reactivex/Observable.java | 140 ++++++++++++++++++++ src/main/java/io/reactivex/Single.java | 77 ++++++++++- 5 files changed, 503 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/reactivex/Completable.java b/src/main/java/io/reactivex/Completable.java index 6d70d6baca..c9f891b500 100644 --- a/src/main/java/io/reactivex/Completable.java +++ b/src/main/java/io/reactivex/Completable.java @@ -451,10 +451,23 @@ public static Completable fromSingle(final SingleSource single) { *
*
Scheduler:
*
{@code mergeArray} does not operate by default on a particular {@link Scheduler}.
+ *
If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled. + * If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeArrayDelayError(CompletableSource...)} to merge sources and terminate only when all source {@code CompletableSource}s + * have completed or failed with an error. + *
*
* @param sources the iterable sequence of sources. * @return the new Completable instance * @throws NullPointerException if sources is null + * @see #mergeArrayDelayError(CompletableSource...) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -475,10 +488,24 @@ public static Completable mergeArray(CompletableSource... sources) { *
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled. + * If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable)} to merge sources and terminate only when all source {@code CompletableSource}s + * have completed or failed with an error. + *
*
* @param sources the iterable sequence of sources. * @return the new Completable instance * @throws NullPointerException if sources is null + * @see #mergeDelayError(Iterable) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -496,10 +523,23 @@ public static Completable merge(Iterable sources) { * and expects the other {@code Publisher} to honor it as well. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled. + * If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher)} to merge sources and terminate only when all source {@code CompletableSource}s + * have completed or failed with an error. + *
* * @param sources the iterable sequence of sources. * @return the new Completable instance * @throws NullPointerException if sources is null + * @see #mergeDelayError(Publisher) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -517,12 +557,25 @@ public static Completable merge(Publisher sources) * and expects the other {@code Publisher} to honor it as well. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled. + * If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher, int)} to merge sources and terminate only when all source {@code CompletableSource}s + * have completed or failed with an error. + *
* * @param sources the iterable sequence of sources. * @param maxConcurrency the maximum number of concurrent subscriptions * @return the new Completable instance * @throws NullPointerException if sources is null * @throws IllegalArgumentException if maxConcurrency is less than 1 + * @see #mergeDelayError(Publisher, int) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -1253,7 +1306,7 @@ public final Completable doOnSubscribe(Consumer onSubscribe) /** * Returns a Completable instance that calls the given onTerminate callback just before this Completable - * completes normally or with an exception + * completes normally or with an exception. *
*
Scheduler:
*
{@code doOnTerminate} does not operate by default on a particular {@link Scheduler}.
@@ -1272,7 +1325,7 @@ public final Completable doOnTerminate(final Action onTerminate) { /** * Returns a Completable instance that calls the given onTerminate callback after this Completable - * completes normally or with an exception + * completes normally or with an exception. *
*
Scheduler:
*
{@code doAfterTerminate} does not operate by default on a particular {@link Scheduler}.
@@ -2084,7 +2137,7 @@ public final Single toSingleDefault(final T completionValue) { /** * Returns a Completable which makes sure when a subscriber cancels the subscription, the - * dispose is called on the specified scheduler + * dispose is called on the specified scheduler. *
*
Scheduler:
*
{@code unsubscribeOn} calls dispose() of the upstream on the {@link Scheduler} you specify.
diff --git a/src/main/java/io/reactivex/Flowable.java b/src/main/java/io/reactivex/Flowable.java index 87bf672d96..2057359697 100644 --- a/src/main/java/io/reactivex/Flowable.java +++ b/src/main/java/io/reactivex/Flowable.java @@ -2892,6 +2892,19 @@ public static Flowable just(T item1, T item2, T item3, T item4, T item5, * backpressure; if violated, the operator may signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable, int, int)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -2906,6 +2919,7 @@ public static Flowable just(T item1, T item2, T item3, T item4, T item5, * @throws IllegalArgumentException * if {@code maxConcurrency} is less than or equal to 0 * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(Iterable, int, int) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2929,6 +2943,19 @@ public static Flowable merge(Iterable> s * backpressure; if violated, the operator may signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code mergeArray} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeArrayDelayError(int, int, Publisher[])} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -2943,6 +2970,7 @@ public static Flowable merge(Iterable> s * @throws IllegalArgumentException * if {@code maxConcurrency} is less than or equal to 0 * @see ReactiveX operators documentation: Merge + * @see #mergeArrayDelayError(int, int, Publisher...) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2972,7 +3000,7 @@ public static Flowable mergeArray(int maxConcurrency, int bufferSize, Pub * first one's error or, depending on the concurrency of the sources, may terminate with a * {@code CompositeException} containing two or more of the various error signals. * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via - * {@link RxJavaPlugins#onError(Throwable)} method as undeliverable errors. Similarly, {@code Throwable}s + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a * (composite) error will be sent to the same global error handler. * Use {@link #mergeDelayError(Iterable)} to merge sources and terminate only when all source {@code Publisher}s @@ -3010,6 +3038,19 @@ public static Flowable merge(Iterable> s * backpressure; if violated, the operator may signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable, int)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -3022,6 +3063,7 @@ public static Flowable merge(Iterable> s * @throws IllegalArgumentException * if {@code maxConcurrency} is less than or equal to 0 * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(Iterable, int) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -3046,6 +3088,19 @@ public static Flowable merge(Iterable> s * backpressure; if violated, the operator may signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -3054,6 +3109,7 @@ public static Flowable merge(Iterable> s * @return a Flowable that emits items that are the result of flattening the Publishers emitted by the * {@code source} Publisher * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(Publisher) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @@ -3077,6 +3133,19 @@ public static Flowable merge(Publisher> * backpressure; if violated, the operator may signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher, int)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -3089,6 +3158,7 @@ public static Flowable merge(Publisher> * @throws IllegalArgumentException * if {@code maxConcurrency} is less than or equal to 0 * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(Publisher, int) * @since 1.1.0 */ @SuppressWarnings({ "unchecked", "rawtypes" }) @@ -3112,6 +3182,19 @@ public static Flowable merge(Publisher> * backpressure; if violated, the operator may signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code mergeArray} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeArrayDelayError(Publisher...)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -3119,6 +3202,7 @@ public static Flowable merge(Publisher> * the array of Publishers * @return a Flowable that emits all of the items emitted by the Publishers in the Array * @see ReactiveX operators documentation: Merge + * @see #mergeArrayDelayError(Publisher...) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -3141,6 +3225,19 @@ public static Flowable mergeArray(Publisher... sources) { * backpressure; if violated, the operator may signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher, Publisher)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -3150,6 +3247,7 @@ public static Flowable mergeArray(Publisher... sources) { * a Publisher to be merged * @return a Flowable that emits all of the items emitted by the source Publishers * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(Publisher, Publisher) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -3174,6 +3272,19 @@ public static Flowable merge(Publisher source1, Publishermay signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher, Publisher, Publisher)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -3185,6 +3296,7 @@ public static Flowable merge(Publisher source1, PublisherReactiveX operators documentation: Merge + * @see #mergeDelayError(Publisher, Publisher, Publisher) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -3210,6 +3322,19 @@ public static Flowable merge(Publisher source1, Publishermay signal {@code MissingBackpressureException}. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code Publisher}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code Publisher}s are cancelled. + * If more than one {@code Publisher} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher, Publisher, Publisher, Publisher)} to merge sources and terminate only when all source {@code Publisher}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -3223,6 +3348,7 @@ public static Flowable merge(Publisher source1, PublisherReactiveX operators documentation: Merge + * @see #mergeDelayError(Publisher, Publisher, Publisher, Publisher) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue diff --git a/src/main/java/io/reactivex/Maybe.java b/src/main/java/io/reactivex/Maybe.java index fb053a7a13..53c042e0ef 100644 --- a/src/main/java/io/reactivex/Maybe.java +++ b/src/main/java/io/reactivex/Maybe.java @@ -777,10 +777,24 @@ public static Maybe just(T item) { *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code MaybeSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code MaybeSource}s are cancelled. + * If more than one {@code MaybeSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable)} to merge sources and terminate only when all source {@code MaybeSource}s + * have completed or failed with an error. + *
* * @param the common and resulting value type * @param sources the Iterable sequence of MaybeSource sources * @return the new Flowable instance + * @see #mergeDelayError(Iterable) */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -797,10 +811,24 @@ public static Flowable merge(Iterable> *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code MaybeSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code MaybeSource}s are cancelled. + * If more than one {@code MaybeSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher)} to merge sources and terminate only when all source {@code MaybeSource}s + * have completed or failed with an error. + *
* * @param the common and resulting value type * @param sources the Flowable sequence of MaybeSource sources * @return the new Flowable instance + * @see #mergeDelayError(Publisher) */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -817,11 +845,25 @@ public static Flowable merge(Publisher *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code MaybeSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code MaybeSource}s are cancelled. + * If more than one {@code MaybeSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher, int)} to merge sources and terminate only when all source {@code MaybeSource}s + * have completed or failed with an error. + *
* * @param the common and resulting value type * @param sources the Flowable sequence of MaybeSource sources * @param maxConcurrency the maximum number of concurrently running MaybeSources * @return the new Flowable instance + * @see #mergeDelayError(Publisher, int) */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -841,6 +883,12 @@ public static Flowable merge(Publisher *
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
The resulting {@code Maybe} emits the outer source's or the inner {@code MaybeSource}'s {@code Throwable} as is. + * Unlike the other {@code merge()} operators, this operator won't and can't produce a {@code CompositeException} because there is + * only one possibility for the outer or the inner {@code MaybeSource} to emit an {@code onError} signal. + * Therefore, there is no need for a {@code mergeDelayError(MaybeSource>)} operator. + *
*
* * @param the value type of the sources and the output @@ -870,6 +918,19 @@ public static Maybe merge(MaybeSource> *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code MaybeSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code MaybeSource}s are cancelled. + * If more than one {@code MaybeSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(MaybeSource, MaybeSource)} to merge sources and terminate only when all source {@code MaybeSource}s + * have completed or failed with an error. + *
* * * @param the common value type @@ -879,6 +940,7 @@ public static Maybe merge(MaybeSource> * a MaybeSource to be merged * @return a Flowable that emits all of the items emitted by the source MaybeSources * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(MaybeSource, MaybeSource) */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -904,6 +966,19 @@ public static Flowable merge( *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code MaybeSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code MaybeSource}s are cancelled. + * If more than one {@code MaybeSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(MaybeSource, MaybeSource, MaybeSource)} to merge sources and terminate only when all source {@code MaybeSource}s + * have completed or failed with an error. + *
* * * @param the common value type @@ -915,6 +990,7 @@ public static Flowable merge( * a MaybeSource to be merged * @return a Flowable that emits all of the items emitted by the source MaybeSources * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(MaybeSource, MaybeSource, MaybeSource) */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -942,6 +1018,19 @@ public static Flowable merge( *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code MaybeSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code MaybeSource}s are cancelled. + * If more than one {@code MaybeSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(MaybeSource, MaybeSource, MaybeSource, MaybeSource)} to merge sources and terminate only when all source {@code MaybeSource}s + * have completed or failed with an error. + *
* * * @param the common value type @@ -955,6 +1044,7 @@ public static Flowable merge( * a MaybeSource to be merged * @return a Flowable that emits all of the items emitted by the source MaybeSources * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(MaybeSource, MaybeSource, MaybeSource, MaybeSource) */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -979,10 +1069,24 @@ public static Flowable merge( *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code mergeArray} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code MaybeSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code MaybeSource}s are cancelled. + * If more than one {@code MaybeSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeArrayDelayError(MaybeSource...)} to merge sources and terminate only when all source {@code MaybeSource}s + * have completed or failed with an error. + *
* * @param the common and resulting value type * @param sources the array sequence of MaybeSource sources * @return the new Flowable instance + * @see #mergeArrayDelayError(MaybeSource...) */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index ae5942bcd1..fc39bc0de3 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -2635,6 +2635,19 @@ public static Observable just(T item1, T item2, T item3, T item4, T item5 *
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable, int, int)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -2649,6 +2662,7 @@ public static Observable just(T item1, T item2, T item3, T item4, T item5 * @throws IllegalArgumentException * if {@code maxConcurrent} is less than or equal to 0 * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(Iterable, int, int) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2668,6 +2682,19 @@ public static Observable merge(Iterable *
Scheduler:
*
{@code mergeArray} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeArrayDelayError(int, int, ObservableSource...)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -2682,6 +2709,7 @@ public static Observable merge(IterableReactiveX operators documentation: Merge + * @see #mergeArrayDelayError(int, int, ObservableSource...) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2700,6 +2728,19 @@ public static Observable mergeArray(int maxConcurrency, int bufferSize, O *
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -2708,6 +2749,7 @@ public static Observable mergeArray(int maxConcurrency, int bufferSize, O * @return an Observable that emits items that are the result of flattening the items emitted by the * ObservableSources in the Iterable * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(Iterable) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2727,6 +2769,19 @@ public static Observable merge(Iterable *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable, int)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -2739,6 +2794,7 @@ public static Observable merge(IterableReactiveX operators documentation: Merge + * @see #mergeDelayError(Iterable, int) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2758,6 +2814,19 @@ public static Observable merge(Iterable *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(ObservableSource)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -2766,6 +2835,7 @@ public static Observable merge(IterableReactiveX operators documentation: Merge + * @see #mergeDelayError(ObservableSource) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -2787,6 +2857,19 @@ public static Observable merge(ObservableSource *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(ObservableSource, int)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -2800,6 +2883,7 @@ public static Observable merge(ObservableSourceReactiveX operators documentation: Merge * @since 1.1.0 + * @see #mergeDelayError(ObservableSource, int) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2820,6 +2904,19 @@ public static Observable merge(ObservableSource *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(ObservableSource, ObservableSource)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
* * * @param the common element base type @@ -2829,6 +2926,7 @@ public static Observable merge(ObservableSourceReactiveX operators documentation: Merge + * @see #mergeDelayError(ObservableSource, ObservableSource) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2849,6 +2947,19 @@ public static Observable merge(ObservableSource source1, Obs *
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(ObservableSource, ObservableSource, ObservableSource)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -2860,6 +2971,7 @@ public static Observable merge(ObservableSource source1, Obs * an ObservableSource to be merged * @return an Observable that emits all of the items emitted by the source ObservableSources * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(ObservableSource, ObservableSource, ObservableSource) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2881,6 +2993,19 @@ public static Observable merge(ObservableSource source1, Obs *
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(ObservableSource, ObservableSource, ObservableSource, ObservableSource)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -2894,6 +3019,7 @@ public static Observable merge(ObservableSource source1, Obs * an ObservableSource to be merged * @return an Observable that emits all of the items emitted by the source ObservableSources * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(ObservableSource, ObservableSource, ObservableSource, ObservableSource) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @@ -2918,6 +3044,19 @@ public static Observable merge( *
*
Scheduler:
*
{@code mergeArray} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code ObservableSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Observable} terminates with that {@code Throwable} and all other source {@code ObservableSource}s are cancelled. + * If more than one {@code ObservableSource} signals an error, the resulting {@code Observable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Observable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeArrayDelayError(ObservableSource...)} to merge sources and terminate only when all source {@code ObservableSource}s + * have completed or failed with an error. + *
*
* * @param the common element base type @@ -2925,6 +3064,7 @@ public static Observable merge( * the array of ObservableSources * @return an Observable that emits all of the items emitted by the ObservableSources in the Array * @see ReactiveX operators documentation: Merge + * @see #mergeArrayDelayError(ObservableSource...) */ @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue diff --git a/src/main/java/io/reactivex/Single.java b/src/main/java/io/reactivex/Single.java index ed185920cc..4d55b8dd24 100644 --- a/src/main/java/io/reactivex/Single.java +++ b/src/main/java/io/reactivex/Single.java @@ -664,11 +664,25 @@ public static Single just(final T item) { *
The returned {@code Flowable} honors the backpressure of the downstream consumer.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are cancelled. + * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Iterable)} to merge sources and terminate only when all source {@code SingleSource}s + * have completed or failed with an error. + *
* * @param the common and resulting value type * @param sources the Iterable sequence of SingleSource sources * @return the new Flowable instance * @since 2.0 + * @see #mergeDelayError(Iterable) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @@ -685,10 +699,24 @@ public static Flowable merge(Iterable *
The returned {@code Flowable} honors the backpressure of the downstream consumer.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are cancelled. + * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(Publisher)} to merge sources and terminate only when all source {@code SingleSource}s + * have completed or failed with an error. + *
* * @param the common and resulting value type * @param sources the Flowable sequence of SingleSource sources * @return the new Flowable instance + * @see #mergeDelayError(Publisher) * @since 2.0 */ @CheckReturnValue @@ -708,6 +736,11 @@ public static Flowable merge(Publisher *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
The resulting {@code Single} emits the outer source's or the inner {@code SingleSource}'s {@code Throwable} as is. + * Unlike the other {@code merge()} operators, this operator won't and can't produce a {@code CompositeException} because there is + * only one possibility for the outer or the inner {@code SingleSource} to emit an {@code onError} signal. + * Therefore, there is no need for a {@code mergeDelayError(SingleSource>)} operator. + *
* * * @param the value type of the sources and the output @@ -737,6 +770,19 @@ public static Single merge(SingleSourceThe returned {@code Flowable} honors the backpressure of the downstream consumer. *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are cancelled. + * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(SingleSource, SingleSource)} to merge sources and terminate only when all source {@code SingleSource}s + * have completed or failed with an error. + *
* * * @param the common value type @@ -746,6 +792,7 @@ public static Single merge(SingleSourceReactiveX operators documentation: Merge + * @see #mergeDelayError(SingleSource, SingleSource) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @@ -771,6 +818,19 @@ public static Flowable merge( *
The returned {@code Flowable} honors the backpressure of the downstream consumer.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are cancelled. + * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(SingleSource, SingleSource, SingleSource)} to merge sources and terminate only when all source {@code SingleSource}s + * have completed or failed with an error. + *
* * * @param the common value type @@ -782,6 +842,7 @@ public static Flowable merge( * a Single to be merged * @return a Flowable that emits all of the items emitted by the source Singles * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(SingleSource, SingleSource, SingleSource) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @@ -809,6 +870,19 @@ public static Flowable merge( *
The returned {@code Flowable} honors the backpressure of the downstream consumer.
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are cancelled. + * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the + * first one's error or, depending on the concurrency of the sources, may terminate with a + * {@code CompositeException} containing two or more of the various error signals. + * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a + * (composite) error will be sent to the same global error handler. + * Use {@link #mergeDelayError(SingleSource, SingleSource, SingleSource)} to merge sources and terminate only when all source {@code SingleSource}s + * have completed or failed with an error. + *
* * * @param the common value type @@ -822,6 +896,7 @@ public static Flowable merge( * a Single to be merged * @return a Flowable that emits all of the items emitted by the source Singles * @see ReactiveX operators documentation: Merge + * @see #mergeDelayError(SingleSource, SingleSource, SingleSource, SingleSource) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @@ -3217,7 +3292,7 @@ public final Observable toObservable() { /** * Returns a Single which makes sure when a SingleObserver disposes the Disposable, - * that call is propagated up on the specified scheduler + * that call is propagated up on the specified scheduler. *
*
Scheduler:
*
{@code unsubscribeOn} calls dispose() of the upstream on the {@link Scheduler} you specify.