Skip to content

Commit 5e1bc17

Browse files
authored
2.x: Update javadoc for observeOn to mention its eagerness (ReactiveX#6722)
1 parent 170f952 commit 5e1bc17

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/main/java/io/reactivex/Flowable.java

+18
Original file line numberDiff line numberDiff line change
@@ -11590,6 +11590,11 @@ public final Flowable<T> mergeWith(@NonNull CompletableSource other) {
1159011590
* asynchronous. If strict event ordering is required, consider using the {@link #observeOn(Scheduler, boolean)} overload.
1159111591
* <p>
1159211592
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
11593+
* <p>
11594+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
11595+
* which may result in a longer than expected occupation of this thread. In other terms,
11596+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
11597+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
1159311598
* <dl>
1159411599
* <dt><b>Backpressure:</b></dt>
1159511600
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
@@ -11610,6 +11615,7 @@ public final Flowable<T> mergeWith(@NonNull CompletableSource other) {
1161011615
* @see #subscribeOn
1161111616
* @see #observeOn(Scheduler, boolean)
1161211617
* @see #observeOn(Scheduler, boolean, int)
11618+
* @see #delay(long, TimeUnit, Scheduler)
1161311619
*/
1161411620
@CheckReturnValue
1161511621
@BackpressureSupport(BackpressureKind.FULL)
@@ -11623,6 +11629,11 @@ public final Flowable<T> observeOn(Scheduler scheduler) {
1162311629
* asynchronously with a bounded buffer and optionally delays onError notifications.
1162411630
* <p>
1162511631
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
11632+
* <p>
11633+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
11634+
* which may result in a longer than expected occupation of this thread. In other terms,
11635+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
11636+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
1162611637
* <dl>
1162711638
* <dt><b>Backpressure:</b></dt>
1162811639
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
@@ -11647,6 +11658,7 @@ public final Flowable<T> observeOn(Scheduler scheduler) {
1164711658
* @see #subscribeOn
1164811659
* @see #observeOn(Scheduler)
1164911660
* @see #observeOn(Scheduler, boolean, int)
11661+
* @see #delay(long, TimeUnit, Scheduler, boolean)
1165011662
*/
1165111663
@CheckReturnValue
1165211664
@BackpressureSupport(BackpressureKind.FULL)
@@ -11660,6 +11672,11 @@ public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError) {
1166011672
* asynchronously with a bounded buffer of configurable size and optionally delays onError notifications.
1166111673
* <p>
1166211674
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
11675+
* <p>
11676+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
11677+
* which may result in a longer than expected occupation of this thread. In other terms,
11678+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
11679+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
1166311680
* <dl>
1166411681
* <dt><b>Backpressure:</b></dt>
1166511682
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
@@ -11685,6 +11702,7 @@ public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError) {
1168511702
* @see #subscribeOn
1168611703
* @see #observeOn(Scheduler)
1168711704
* @see #observeOn(Scheduler, boolean)
11705+
* @see #delay(long, TimeUnit, Scheduler, boolean)
1168811706
*/
1168911707
@CheckReturnValue
1169011708
@NonNull

src/main/java/io/reactivex/Observable.java

+18
Original file line numberDiff line numberDiff line change
@@ -9902,6 +9902,11 @@ public final Observable<T> mergeWith(@NonNull CompletableSource other) {
99029902
* asynchronous. If strict event ordering is required, consider using the {@link #observeOn(Scheduler, boolean)} overload.
99039903
* <p>
99049904
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
9905+
* <p>
9906+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
9907+
* which may result in a longer than expected occupation of this thread. In other terms,
9908+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
9909+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
99059910
* <dl>
99069911
* <dt><b>Scheduler:</b></dt>
99079912
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
@@ -9918,6 +9923,7 @@ public final Observable<T> mergeWith(@NonNull CompletableSource other) {
99189923
* @see #subscribeOn
99199924
* @see #observeOn(Scheduler, boolean)
99209925
* @see #observeOn(Scheduler, boolean, int)
9926+
* @see #delay(long, TimeUnit, Scheduler)
99219927
*/
99229928
@CheckReturnValue
99239929
@SchedulerSupport(SchedulerSupport.CUSTOM)
@@ -9930,6 +9936,11 @@ public final Observable<T> observeOn(Scheduler scheduler) {
99309936
* asynchronously with an unbounded buffer with {@link Flowable#bufferSize()} "island size" and optionally delays onError notifications.
99319937
* <p>
99329938
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
9939+
* <p>
9940+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
9941+
* which may result in a longer than expected occupation of this thread. In other terms,
9942+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
9943+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
99339944
* <dl>
99349945
* <dt><b>Scheduler:</b></dt>
99359946
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
@@ -9950,6 +9961,7 @@ public final Observable<T> observeOn(Scheduler scheduler) {
99509961
* @see #subscribeOn
99519962
* @see #observeOn(Scheduler)
99529963
* @see #observeOn(Scheduler, boolean, int)
9964+
* @see #delay(long, TimeUnit, Scheduler, boolean)
99539965
*/
99549966
@CheckReturnValue
99559967
@SchedulerSupport(SchedulerSupport.CUSTOM)
@@ -9962,6 +9974,11 @@ public final Observable<T> observeOn(Scheduler scheduler, boolean delayError) {
99629974
* asynchronously with an unbounded buffer of configurable "island size" and optionally delays onError notifications.
99639975
* <p>
99649976
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
9977+
* <p>
9978+
* This operator keeps emitting as many signals as it can on the given Scheduler's Worker thread,
9979+
* which may result in a longer than expected occupation of this thread. In other terms,
9980+
* it does not allow per-signal fairness in case the worker runs on a shared underlying thread.
9981+
* If such fairness and signal/work interleaving is preferred, use the delay operator with zero time instead.
99659982
* <dl>
99669983
* <dt><b>Scheduler:</b></dt>
99679984
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
@@ -9983,6 +10000,7 @@ public final Observable<T> observeOn(Scheduler scheduler, boolean delayError) {
998310000
* @see #subscribeOn
998410001
* @see #observeOn(Scheduler)
998510002
* @see #observeOn(Scheduler, boolean)
10003+
* @see #delay(long, TimeUnit, Scheduler, boolean)
998610004
*/
998710005
@CheckReturnValue
998810006
@SchedulerSupport(SchedulerSupport.CUSTOM)

0 commit comments

Comments
 (0)