Skip to content

Commit 33a498d

Browse files
authored
3.x: observeOn and Schedulers.from eagerness javadoc updates (#6723)
1 parent 7c0793d commit 33a498d

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

Diff for: src/main/java/io/reactivex/rxjava3/core/Flowable.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -11386,6 +11386,11 @@ public final Flowable<T> mergeWith(@NonNull CompletableSource other) {
1138611386
* asynchronous. If strict event ordering is required, consider using the {@link #observeOn(Scheduler, boolean)} overload.
1138711387
* <p>
1138811388
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
11389+
* <p>
11390+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
11391+
* which may result in a longer than expected occupation of this thread. In other terms,
11392+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
11393+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
1138911394
* <dl>
1139011395
* <dt><b>Backpressure:</b></dt>
1139111396
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
@@ -11406,6 +11411,7 @@ public final Flowable<T> mergeWith(@NonNull CompletableSource other) {
1140611411
* @see #subscribeOn
1140711412
* @see #observeOn(Scheduler, boolean)
1140811413
* @see #observeOn(Scheduler, boolean, int)
11414+
* @see #delay(long, TimeUnit, Scheduler)
1140911415
*/
1141011416
@CheckReturnValue
1141111417
@BackpressureSupport(BackpressureKind.FULL)
@@ -11424,7 +11430,6 @@ public final Flowable<T> observeOn(Scheduler scheduler) {
1142411430
* which may result in a longer than expected occupation of this thread. In other terms,
1142511431
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
1142611432
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
11427-
* <p>
1142811433
* <dl>
1142911434
* <dt><b>Backpressure:</b></dt>
1143011435
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
@@ -11449,7 +11454,7 @@ public final Flowable<T> observeOn(Scheduler scheduler) {
1144911454
* @see #subscribeOn
1145011455
* @see #observeOn(Scheduler)
1145111456
* @see #observeOn(Scheduler, boolean, int)
11452-
* @see #delay(long, TimeUnit, Scheduler)
11457+
* @see #delay(long, TimeUnit, Scheduler, boolean)
1145311458
*/
1145411459
@CheckReturnValue
1145511460
@BackpressureSupport(BackpressureKind.FULL)
@@ -11468,7 +11473,6 @@ public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError) {
1146811473
* which may result in a longer than expected occupation of this thread. In other terms,
1146911474
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
1147011475
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
11471-
* <p>
1147211476
* <dl>
1147311477
* <dt><b>Backpressure:</b></dt>
1147411478
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
@@ -11494,7 +11498,7 @@ public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError) {
1149411498
* @see #subscribeOn
1149511499
* @see #observeOn(Scheduler)
1149611500
* @see #observeOn(Scheduler, boolean)
11497-
* @see #delay(long, TimeUnit, Scheduler)
11501+
* @see #delay(long, TimeUnit, Scheduler, boolean)
1149811502
*/
1149911503
@CheckReturnValue
1150011504
@NonNull

Diff for: src/main/java/io/reactivex/rxjava3/core/Observable.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -9793,6 +9793,11 @@ public final Observable<T> mergeWith(@NonNull CompletableSource other) {
97939793
* asynchronous. If strict event ordering is required, consider using the {@link #observeOn(Scheduler, boolean)} overload.
97949794
* <p>
97959795
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
9796+
* <p>
9797+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
9798+
* which may result in a longer than expected occupation of this thread. In other terms,
9799+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
9800+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
97969801
* <dl>
97979802
* <dt><b>Scheduler:</b></dt>
97989803
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
@@ -9809,6 +9814,7 @@ public final Observable<T> mergeWith(@NonNull CompletableSource other) {
98099814
* @see #subscribeOn
98109815
* @see #observeOn(Scheduler, boolean)
98119816
* @see #observeOn(Scheduler, boolean, int)
9817+
* @see #delay(long, TimeUnit, Scheduler)
98129818
*/
98139819
@CheckReturnValue
98149820
@SchedulerSupport(SchedulerSupport.CUSTOM)
@@ -9826,7 +9832,6 @@ public final Observable<T> observeOn(Scheduler scheduler) {
98269832
* which may result in a longer than expected occupation of this thread. In other terms,
98279833
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
98289834
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
9829-
* <p>
98309835
* <dl>
98319836
* <dt><b>Scheduler:</b></dt>
98329837
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
@@ -9847,7 +9852,7 @@ public final Observable<T> observeOn(Scheduler scheduler) {
98479852
* @see #subscribeOn
98489853
* @see #observeOn(Scheduler)
98499854
* @see #observeOn(Scheduler, boolean, int)
9850-
* @see #delay(long, TimeUnit, Scheduler)
9855+
* @see #delay(long, TimeUnit, Scheduler, boolean)
98519856
*/
98529857
@CheckReturnValue
98539858
@SchedulerSupport(SchedulerSupport.CUSTOM)
@@ -9865,7 +9870,6 @@ public final Observable<T> observeOn(Scheduler scheduler, boolean delayError) {
98659870
* which may result in a longer than expected occupation of this thread. In other terms,
98669871
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
98679872
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
9868-
* <p>
98699873
* <dl>
98709874
* <dt><b>Scheduler:</b></dt>
98719875
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
@@ -9887,7 +9891,7 @@ public final Observable<T> observeOn(Scheduler scheduler, boolean delayError) {
98879891
* @see #subscribeOn
98889892
* @see #observeOn(Scheduler)
98899893
* @see #observeOn(Scheduler, boolean)
9890-
* @see #delay(long, TimeUnit, Scheduler)
9894+
* @see #delay(long, TimeUnit, Scheduler, boolean)
98919895
*/
98929896
@CheckReturnValue
98939897
@SchedulerSupport(SchedulerSupport.CUSTOM)

Diff for: src/main/java/io/reactivex/rxjava3/schedulers/Schedulers.java

+10
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ public static Scheduler single() {
317317
* with a time delay close to each other may end up executing in different order than
318318
* the original schedule() call was issued. This limitation may be lifted in a future patch.
319319
* <p>
320+
* The implementation of the Worker of this wrapper Scheduler is eager and will execute as many
321+
* non-delayed tasks as it can, which may result in a longer than expected occupation of a
322+
* thread of the given backing Executor. In other terms, it does not allow per-Runnable fairness
323+
* in case the worker runs on a shared underlying thread of the Executor.
324+
* <p>
320325
* Starting, stopping and restarting this scheduler is not supported (no-op) and the provided
321326
* executor's lifecycle must be managed externally:
322327
* <pre><code>
@@ -373,6 +378,11 @@ public static Scheduler from(@NonNull Executor executor) {
373378
* with a time delay close to each other may end up executing in different order than
374379
* the original schedule() call was issued. This limitation may be lifted in a future patch.
375380
* <p>
381+
* The implementation of the Worker of this wrapper Scheduler is eager and will execute as many
382+
* non-delayed tasks as it can, which may result in a longer than expected occupation of a
383+
* thread of the given backing Executor. In other terms, it does not allow per-Runnable fairness
384+
* in case the worker runs on a shared underlying thread of the Executor.
385+
* <p>
376386
* Starting, stopping and restarting this scheduler is not supported (no-op) and the provided
377387
* executor's lifecycle must be managed externally:
378388
* <pre><code>

0 commit comments

Comments
 (0)