From 65365b69d131f392765ac95d17b2f6da75a54de7 Mon Sep 17 00:00:00 2001 From: Josemy Duarte Date: Sat, 2 Nov 2019 01:11:38 +0100 Subject: [PATCH 1/2] Update javadoc for observeOn to mention its eagerness --- .../java/io/reactivex/rxjava3/core/Flowable.java | 12 ++++++++++++ .../java/io/reactivex/rxjava3/core/Observable.java | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/main/java/io/reactivex/rxjava3/core/Flowable.java b/src/main/java/io/reactivex/rxjava3/core/Flowable.java index 290ef279eb..fe22b43d54 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Flowable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Flowable.java @@ -11418,6 +11418,11 @@ public final Flowable observeOn(Scheduler scheduler) { * Modifies a Publisher to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with a bounded buffer and optionally delays onError notifications. *

+ * This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, + * which may result in a longer than expected occupation of this thread. In other terms, + * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. + * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. + *

* *

*
Backpressure:
@@ -11441,6 +11446,7 @@ public final Flowable observeOn(Scheduler scheduler) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn + * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean, int) */ @@ -11455,6 +11461,11 @@ public final Flowable observeOn(Scheduler scheduler, boolean delayError) { * Modifies a Publisher to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with a bounded buffer of configurable size and optionally delays onError notifications. *

+ * This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, + * which may result in a longer than expected occupation of this thread. In other terms, + * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. + * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. + *

* *

*
Backpressure:
@@ -11479,6 +11490,7 @@ public final Flowable observeOn(Scheduler scheduler, boolean delayError) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn + * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean) */ diff --git a/src/main/java/io/reactivex/rxjava3/core/Observable.java b/src/main/java/io/reactivex/rxjava3/core/Observable.java index d5b2895122..6c6ba5753a 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Observable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Observable.java @@ -9820,6 +9820,11 @@ public final Observable observeOn(Scheduler scheduler) { * Modifies an ObservableSource to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with an unbounded buffer with {@link Flowable#bufferSize()} "island size" and optionally delays onError notifications. *

+ * This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, + * which may result in a longer than expected occupation of this thread. In other terms, + * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. + * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. + *

* *

*
Scheduler:
@@ -9839,6 +9844,7 @@ public final Observable observeOn(Scheduler scheduler) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn + * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean, int) */ @@ -9852,6 +9858,11 @@ public final Observable observeOn(Scheduler scheduler, boolean delayError) { * Modifies an ObservableSource to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with an unbounded buffer of configurable "island size" and optionally delays onError notifications. *

+ * This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, + * which may result in a longer than expected occupation of this thread. In other terms, + * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. + * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. + *

* *

*
Scheduler:
@@ -9872,6 +9883,7 @@ public final Observable observeOn(Scheduler scheduler, boolean delayError) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn + * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean) */ From b0e26a358d909552cdce5942c3eee03156f490f9 Mon Sep 17 00:00:00 2001 From: Josemy Duarte Date: Sat, 2 Nov 2019 15:19:55 +0100 Subject: [PATCH 2/2] Update javadoc order --- src/main/java/io/reactivex/rxjava3/core/Flowable.java | 10 ++++++---- .../java/io/reactivex/rxjava3/core/Observable.java | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/reactivex/rxjava3/core/Flowable.java b/src/main/java/io/reactivex/rxjava3/core/Flowable.java index fe22b43d54..52d1f7c428 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Flowable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Flowable.java @@ -11418,12 +11418,13 @@ public final Flowable observeOn(Scheduler scheduler) { * Modifies a Publisher to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with a bounded buffer and optionally delays onError notifications. *

+ * + *

* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, * which may result in a longer than expected occupation of this thread. In other terms, * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. *

- * *

*
Backpressure:
*
This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this @@ -11446,9 +11447,9 @@ public final Flowable observeOn(Scheduler scheduler) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn - * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean, int) + * @see #delay(long, TimeUnit, Scheduler) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @@ -11461,12 +11462,13 @@ public final Flowable observeOn(Scheduler scheduler, boolean delayError) { * Modifies a Publisher to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with a bounded buffer of configurable size and optionally delays onError notifications. *

+ * + *

* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, * which may result in a longer than expected occupation of this thread. In other terms, * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. *

- * *

*
Backpressure:
*
This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this @@ -11490,9 +11492,9 @@ public final Flowable observeOn(Scheduler scheduler, boolean delayError) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn - * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean) + * @see #delay(long, TimeUnit, Scheduler) */ @CheckReturnValue @NonNull diff --git a/src/main/java/io/reactivex/rxjava3/core/Observable.java b/src/main/java/io/reactivex/rxjava3/core/Observable.java index 6c6ba5753a..c8a668d6dc 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Observable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Observable.java @@ -9820,12 +9820,13 @@ public final Observable observeOn(Scheduler scheduler) { * Modifies an ObservableSource to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with an unbounded buffer with {@link Flowable#bufferSize()} "island size" and optionally delays onError notifications. *

+ * + *

* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, * which may result in a longer than expected occupation of this thread. In other terms, * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. *

- * *

*
Scheduler:
*
You specify which {@link Scheduler} this operator will use.
@@ -9844,9 +9845,9 @@ public final Observable observeOn(Scheduler scheduler) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn - * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean, int) + * @see #delay(long, TimeUnit, Scheduler) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) @@ -9858,12 +9859,13 @@ public final Observable observeOn(Scheduler scheduler, boolean delayError) { * Modifies an ObservableSource to perform its emissions and notifications on a specified {@link Scheduler}, * asynchronously with an unbounded buffer of configurable "island size" and optionally delays onError notifications. *

+ * + *

* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread, * which may result in a longer than expected occupation of this thread. In other terms, * it does not allow per-signal fairness in case the worker runs on a shared underlying thread. * If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead. *

- * *

*
Scheduler:
*
You specify which {@link Scheduler} this operator will use.
@@ -9883,9 +9885,9 @@ public final Observable observeOn(Scheduler scheduler, boolean delayError) { * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn - * @see #delay(long, TimeUnit, Scheduler) * @see #observeOn(Scheduler) * @see #observeOn(Scheduler, boolean) + * @see #delay(long, TimeUnit, Scheduler) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM)