From f4b07d87b9fff88f5254cc45a39ab6e33d840cec Mon Sep 17 00:00:00 2001 From: David Gross Date: Fri, 21 Oct 2016 15:37:52 -0700 Subject: [PATCH] Add more new marble diagrams & update old ones --- src/main/java/io/reactivex/Observable.java | 103 +++++++++++++++------ 1 file changed, 76 insertions(+), 27 deletions(-) diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index 532361c4d0..3c376f36da 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -131,7 +131,8 @@ public static int bufferSize() { * Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the * implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a * {@code Function} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatest} does not operate by default on a particular {@link Scheduler}.
@@ -164,7 +165,8 @@ public static Observable combineLatest(Function} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatest} does not operate by default on a particular {@link Scheduler}.
@@ -197,7 +199,8 @@ public static Observable combineLatest(Iterable} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatest} does not operate by default on a particular {@link Scheduler}.
@@ -237,7 +240,8 @@ public static Observable combineLatest(Iterable} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatest} does not operate by default on a particular {@link Scheduler}.
@@ -269,7 +273,8 @@ public static Observable combineLatest(ObservableSource[] * Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the * implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a * {@code Function} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatest} does not operate by default on a particular {@link Scheduler}.
@@ -736,7 +741,8 @@ public static Observable combineLatestDelayError(Function} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatestDelayError} does not operate by default on a particular {@link Scheduler}.
@@ -778,7 +784,8 @@ public static Observable combineLatestDelayError(ObservableSource} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatestDelayError} does not operate by default on a particular {@link Scheduler}.
@@ -811,7 +818,8 @@ public static Observable combineLatestDelayError(Iterable} passed to the method would trigger a {@code ClassCastException}. - * + *

+ * *

*
Scheduler:
*
{@code combineLatestDelayError} does not operate by default on a particular {@link Scheduler}.
@@ -1000,6 +1008,8 @@ public static Observable concat( * Concatenates a variable number of ObservableSource sources. *

* Note: named this way because of overload conflict with concat(ObservableSource<ObservableSource>) + *

+ * *

*
Scheduler:
*
{@code concatArray} does not operate by default on a particular {@link Scheduler}.
@@ -1025,7 +1035,7 @@ public static Observable concatArray(ObservableSource... sou * Concatenates a variable number of ObservableSource sources and delays errors from any of them * till all terminate. *

- * + * *

*
Scheduler:
*
{@code concatArrayDelayError} does not operate by default on a particular {@link Scheduler}.
@@ -1053,6 +1063,8 @@ public static Observable concatArrayDelayError(ObservableSource + * *
*
Scheduler:
*
This method does not operate by default on a particular {@link Scheduler}.
@@ -1094,7 +1106,8 @@ public static Observable concatArrayEager(int maxConcurrency, int prefetc /** * Concatenates the Iterable sequence of ObservableSources into a single sequence by subscribing to each ObservableSource, * one after the other, one at a time and delays any errors till the all inner ObservableSources terminate. - * + *

+ * *

*
Scheduler:
*
{@code concatDelayError} does not operate by default on a particular {@link Scheduler}.
@@ -1113,7 +1126,8 @@ public static Observable concatDelayError(Iterable + * *
*
Scheduler:
*
{@code concatDelayError} does not operate by default on a particular {@link Scheduler}.
@@ -1131,7 +1145,8 @@ public static Observable concatDelayError(ObservableSource + * *
*
Scheduler:
*
{@code concatDelayError} does not operate by default on a particular {@link Scheduler}.
@@ -1156,6 +1171,8 @@ public static Observable concatDelayError(ObservableSource + * *
*
Scheduler:
*
This method does not operate by default on a particular {@link Scheduler}.
@@ -1176,6 +1193,8 @@ public static Observable concatEager(ObservableSource + * *
*
Scheduler:
*
This method does not operate by default on a particular {@link Scheduler}.
@@ -1200,6 +1219,8 @@ public static Observable concatEager(ObservableSource + * *
*
Scheduler:
*
This method does not operate by default on a particular {@link Scheduler}.
@@ -1220,6 +1241,8 @@ public static Observable concatEager(Iterable + * *
*
Scheduler:
*
This method does not operate by default on a particular {@link Scheduler}.
@@ -1266,6 +1289,8 @@ public static Observable concatEager(Iterable *

+ * + *

* You should call the ObservableEmitter's onNext, onError and onComplete methods in a serialized fashion. The * rest of its methods are thread-safe. *

@@ -1632,6 +1657,7 @@ public static Observable fromPublisher(Publisher publisher) /** * Returns a cold, synchronous and stateless generator of values. *

+ * *

*
Scheduler:
*
{@code generate} does not operate by default on a particular {@link Scheduler}.
@@ -1654,6 +1680,7 @@ public static Observable generate(final Consumer> generator) { /** * Returns a cold, synchronous and stateful generator of values. *

+ * *

*
Scheduler:
*
{@code generate} does not operate by default on a particular {@link Scheduler}.
@@ -1677,6 +1704,7 @@ public static Observable generate(Callable initialState, final BiCo /** * Returns a cold, synchronous and stateful generator of values. *

+ * *

*
Scheduler:
*
{@code generate} does not operate by default on a particular {@link Scheduler}.
@@ -1705,6 +1733,7 @@ public static Observable generate( /** * Returns a cold, synchronous and stateful generator of values. *

+ * *

*
Scheduler:
*
{@code generate} does not operate by default on a particular {@link Scheduler}.
@@ -1728,6 +1757,7 @@ public static Observable generate(Callable initialState, BiFunction /** * Returns a cold, synchronous and stateful generator of values. *

+ * *

*
Scheduler:
*
{@code generate} does not operate by default on a particular {@link Scheduler}.
@@ -1860,6 +1890,8 @@ public static Observable interval(long period, TimeUnit unit, Scheduler sc * Signals a range of long values, the first after some initial delay and the rest periodically after. *

* The sequence completes immediately after the last value (start + count - 1) has been reached. + *

+ * *

*
Scheduler:
*
{@code intervalRange} by default operates on the {@link Schedulers#computation() computation} {@link Scheduler}.
@@ -1880,7 +1912,8 @@ public static Observable intervalRange(long start, long count, long initia * Signals a range of long values, the first after some initial delay and the rest periodically after. *

* The sequence completes immediately after the last value (start + count - 1) has been reached. - *

+ *

+ * *

*
Scheduler:
*
you provide the {@link Scheduler}.
*
@@ -4192,7 +4225,7 @@ public static Observable zip( * {@code Function} passed to the method would trigger a {@code ClassCastException}. * *

- * + * *

*
Scheduler:
*
{@code zipArray} does not operate by default on a particular {@link Scheduler}.
@@ -4337,7 +4370,7 @@ public final Observable ambWith(ObservableSource other) { * specified condition, otherwise {@code false}. Note: this always emits {@code false} if the * source ObservableSource is empty. *

- * + * *

* In Rx.Net this is the {@code any} Observer but we renamed it in RxJava to better match Java naming * idioms. @@ -6163,6 +6196,7 @@ public final Observable delay(ObservableSource subscriptionDelay, * Returns an Observable that delays the subscription to this Observable * until the other Observable emits an element or completes normally. *

+ * *

*
Scheduler:
*
This method does not operate by default on a particular {@link Scheduler}.
@@ -6387,7 +6421,7 @@ public final Observable distinctUntilChanged(BiPredicate - * + * *
*
Scheduler:
*
{@code doAfterTerminate} does not operate by default on a particular {@link Scheduler}.
@@ -6555,7 +6589,7 @@ public final Observable doOnError(Consumer onError) { * Calls the appropriate onXXX method (shared between all Observer) for the lifecycle events of * the sequence (subscription, cancellation, requesting). *

- * + * *

*
Scheduler:
*
{@code doOnLifecycle} does not operate by default on a particular {@link Scheduler}.
@@ -7298,6 +7332,8 @@ public final Observable flatMapIterable(final Function + * *
*
Scheduler:
*
{@code flatMapMaybe} does not operate by default on a particular {@link Scheduler}.
@@ -7314,6 +7350,8 @@ public final Observable flatMapMaybe(Function + * *
*
Scheduler:
*
{@code flatMapMaybe} does not operate by default on a particular {@link Scheduler}.
@@ -7333,6 +7371,8 @@ public final Observable flatMapMaybe(Function + * *
*
Scheduler:
*
{@code flatMapSingle} does not operate by default on a particular {@link Scheduler}.
@@ -7349,6 +7389,8 @@ public final Observable flatMapSingle(Function + * *
*
Scheduler:
*
{@code flatMapSingle} does not operate by default on a particular {@link Scheduler}.
@@ -9072,7 +9114,8 @@ public final Observable retry(long times) { /** * Retries at most times or until the predicate returns false, whichever happens first. - * + *

+ * *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
@@ -9093,6 +9136,8 @@ public final Observable retry(long times, Predicate predic /** * Retries the current Observable if the predicate returns true. + *

+ * *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
@@ -9108,7 +9153,8 @@ public final Observable retry(Predicate predicate) { /** * Retries until the given stop function returns true. - *
+ *

+ * *

*
Scheduler:
*
{@code retryUntil} does not operate by default on a particular {@link Scheduler}.
*
@@ -11421,7 +11467,7 @@ public final Single> toList() { * Returns a Single that emits a single item, a list composed of all the items emitted by the source * ObservableSource. *

- * + * *

* Normally, an ObservableSource that returns multiple items will do so by invoking its {@link Observer}'s * {@link Observer#onNext onNext} method for each such item. You can change this behavior, instructing the @@ -12454,7 +12500,8 @@ public final Observable withLatestFrom(ObservableSource o * least one value. The resulting emission only happens when this ObservableSource emits (and * not when any of the other sources emit, unlike combineLatest). * If a source doesn't produce any value and just completes, the sequence is completed immediately. - * + *

+ * *

*
Scheduler:
*
This operator does not operate by default on a particular {@link Scheduler}.
@@ -12488,7 +12535,8 @@ public final Observable withLatestFrom( * least one value. The resulting emission only happens when this ObservableSource emits (and * not when any of the other sources emit, unlike combineLatest). * If a source doesn't produce any value and just completes, the sequence is completed immediately. - * + *

+ * *

*
Scheduler:
*
This operator does not operate by default on a particular {@link Scheduler}.
@@ -12526,7 +12574,8 @@ public final Observable withLatestFrom( * least one value. The resulting emission only happens when this ObservableSource emits (and * not when any of the other sources emit, unlike combineLatest). * If a source doesn't produce any value and just completes, the sequence is completed immediately. - * + *

+ * *

*
Scheduler:
*
This operator does not operate by default on a particular {@link Scheduler}.
@@ -12567,7 +12616,8 @@ public final Observable withLatestFrom( * least one value. The resulting emission only happens when this ObservableSource emits (and * not when any of the other sources emit, unlike combineLatest). * If a source doesn't produce any value and just completes, the sequence is completed immediately. - * + *

+ * *

*
Scheduler:
*
This operator does not operate by default on a particular {@link Scheduler}.
@@ -12594,7 +12644,8 @@ public final Observable withLatestFrom(ObservableSource[] others, Func * least one value. The resulting emission only happens when this ObservableSource emits (and * not when any of the other sources emit, unlike combineLatest). * If a source doesn't produce any value and just completes, the sequence is completed immediately. - * + *

+ * *

*
Scheduler:
*
This operator does not operate by default on a particular {@link Scheduler}.
@@ -12692,7 +12743,6 @@ public final Observable zipWith(ObservableSource other, * Returns an Observable that emits items that are the result of applying a specified function to pairs of * values, one each from the source ObservableSource and another specified ObservableSource. *

- *

* The operator subscribes to its sources in order they are specified and completes eagerly if * one of the sources is shorter than the rest while unsubscribing the other sources. Therefore, it * is possible those other sources will never be able to run to completion (and thus not calling @@ -12737,7 +12787,6 @@ public final Observable zipWith(ObservableSource other, * Returns an Observable that emits items that are the result of applying a specified function to pairs of * values, one each from the source ObservableSource and another specified ObservableSource. *

- *

* The operator subscribes to its sources in order they are specified and completes eagerly if * one of the sources is shorter than the rest while unsubscribing the other sources. Therefore, it * is possible those other sources will never be able to run to completion (and thus not calling