Skip to content

3.x: observeOn and Schedulers.from eagerness javadoc updates #6723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/main/java/io/reactivex/rxjava3/core/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -11386,6 +11386,11 @@ public final Flowable<T> mergeWith(@NonNull CompletableSource other) {
* asynchronous. If strict event ordering is required, consider using the {@link #observeOn(Scheduler, boolean)} overload.
* <p>
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
* <p>
* 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.
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
Expand All @@ -11406,6 +11411,7 @@ public final Flowable<T> mergeWith(@NonNull CompletableSource other) {
* @see #subscribeOn
* @see #observeOn(Scheduler, boolean)
* @see #observeOn(Scheduler, boolean, int)
* @see #delay(long, TimeUnit, Scheduler)
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
Expand All @@ -11424,7 +11430,6 @@ public final Flowable<T> observeOn(Scheduler scheduler) {
* 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.
* <p>
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
Expand All @@ -11449,7 +11454,7 @@ public final Flowable<T> observeOn(Scheduler scheduler) {
* @see #subscribeOn
* @see #observeOn(Scheduler)
* @see #observeOn(Scheduler, boolean, int)
* @see #delay(long, TimeUnit, Scheduler)
* @see #delay(long, TimeUnit, Scheduler, boolean)
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
Expand All @@ -11468,7 +11473,6 @@ public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError) {
* 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.
* <p>
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
Expand All @@ -11494,7 +11498,7 @@ public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError) {
* @see #subscribeOn
* @see #observeOn(Scheduler)
* @see #observeOn(Scheduler, boolean)
* @see #delay(long, TimeUnit, Scheduler)
* @see #delay(long, TimeUnit, Scheduler, boolean)
*/
@CheckReturnValue
@NonNull
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/io/reactivex/rxjava3/core/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -9793,6 +9793,11 @@ public final Observable<T> mergeWith(@NonNull CompletableSource other) {
* asynchronous. If strict event ordering is required, consider using the {@link #observeOn(Scheduler, boolean)} overload.
* <p>
* <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
* <p>
* 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.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
Expand All @@ -9809,6 +9814,7 @@ public final Observable<T> mergeWith(@NonNull CompletableSource other) {
* @see #subscribeOn
* @see #observeOn(Scheduler, boolean)
* @see #observeOn(Scheduler, boolean, int)
* @see #delay(long, TimeUnit, Scheduler)
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
Expand All @@ -9826,7 +9832,6 @@ public final Observable<T> observeOn(Scheduler scheduler) {
* 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.
* <p>
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
Expand All @@ -9847,7 +9852,7 @@ public final Observable<T> observeOn(Scheduler scheduler) {
* @see #subscribeOn
* @see #observeOn(Scheduler)
* @see #observeOn(Scheduler, boolean, int)
* @see #delay(long, TimeUnit, Scheduler)
* @see #delay(long, TimeUnit, Scheduler, boolean)
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
Expand All @@ -9865,7 +9870,6 @@ public final Observable<T> observeOn(Scheduler scheduler, boolean delayError) {
* 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.
* <p>
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
Expand All @@ -9887,7 +9891,7 @@ public final Observable<T> observeOn(Scheduler scheduler, boolean delayError) {
* @see #subscribeOn
* @see #observeOn(Scheduler)
* @see #observeOn(Scheduler, boolean)
* @see #delay(long, TimeUnit, Scheduler)
* @see #delay(long, TimeUnit, Scheduler, boolean)
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/io/reactivex/rxjava3/schedulers/Schedulers.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ public static Scheduler single() {
* with a time delay close to each other may end up executing in different order than
* the original schedule() call was issued. This limitation may be lifted in a future patch.
* <p>
* The implementation of the Worker of this wrapper Scheduler is eager and will execute as many
* non-delayed tasks as it can, which may result in a longer than expected occupation of a
* thread of the given backing Executor. In other terms, it does not allow per-Runnable fairness
* in case the worker runs on a shared underlying thread of the Executor.
* <p>
* Starting, stopping and restarting this scheduler is not supported (no-op) and the provided
* executor's lifecycle must be managed externally:
* <pre><code>
Expand Down Expand Up @@ -373,6 +378,11 @@ public static Scheduler from(@NonNull Executor executor) {
* with a time delay close to each other may end up executing in different order than
* the original schedule() call was issued. This limitation may be lifted in a future patch.
* <p>
* The implementation of the Worker of this wrapper Scheduler is eager and will execute as many
* non-delayed tasks as it can, which may result in a longer than expected occupation of a
* thread of the given backing Executor. In other terms, it does not allow per-Runnable fairness
* in case the worker runs on a shared underlying thread of the Executor.
* <p>
* Starting, stopping and restarting this scheduler is not supported (no-op) and the provided
* executor's lifecycle must be managed externally:
* <pre><code>
Expand Down