Skip to content

Commit 4c97d20

Browse files
authored
3.x: Update observeOn docs with links and +backpressure explanation (#6750)
1 parent 1e29958 commit 4c97d20

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

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

+30-6
Original file line numberDiff line numberDiff line change
@@ -11419,8 +11419,16 @@ public final Flowable<T> mergeWith(@NonNull CompletableSource other) {
1141911419
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
1142011420
* expectation will lead to {@code MissingBackpressureException}. This is the most common operator where the exception
1142111421
* pops up; look for sources up the chain that don't support backpressure,
11422-
* such as {@code interval}, {@code timer}, {code PublishSubject} or {@code BehaviorSubject} and apply any
11423-
* of the {@code onBackpressureXXX} operators <strong>before</strong> applying {@code observeOn} itself.</dd>
11422+
* such as {@link #interval(long, TimeUnit)}, {@link #timer(long, TimeUnit)},
11423+
* {@link io.reactivex.rxjava3.processors.PublishProcessor PublishProcessor} or
11424+
* {@link io.reactivex.rxjava3.processors.BehaviorProcessor BehaviorProcessor} and apply any
11425+
* of the {@code onBackpressureXXX} operators <strong>before</strong> applying {@code observeOn} itself.
11426+
* Note also that request amounts are not preserved between the immediate downstream and the
11427+
* immediate upstream. The operator always requests the default {@link #bufferSize()} amount first, then after
11428+
* every 75% of that amount delivered, another 75% of this default value. If preserving the request amounts
11429+
* is to be preferred over potential excess scheduler infrastructure use, consider applying
11430+
* {@link #delay(long, TimeUnit, Scheduler)} with zero time instead.
11431+
* </dd>
1142411432
* <dt><b>Scheduler:</b></dt>
1142511433
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
1142611434
* </dl>
@@ -11458,8 +11466,16 @@ public final Flowable<T> observeOn(Scheduler scheduler) {
1145811466
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
1145911467
* expectation will lead to {@code MissingBackpressureException}. This is the most common operator where the exception
1146011468
* pops up; look for sources up the chain that don't support backpressure,
11461-
* such as {@code interval}, {@code timer}, {code PublishSubject} or {@code BehaviorSubject} and apply any
11462-
* of the {@code onBackpressureXXX} operators <strong>before</strong> applying {@code observeOn} itself.</dd>
11469+
* such as {@link #interval(long, TimeUnit)}, {@link #timer(long, TimeUnit)},
11470+
* {@link io.reactivex.rxjava3.processors.PublishProcessor PublishProcessor} or
11471+
* {@link io.reactivex.rxjava3.processors.BehaviorProcessor BehaviorProcessor} and apply any
11472+
* of the {@code onBackpressureXXX} operators <strong>before</strong> applying {@code observeOn} itself.
11473+
* Note also that request amounts are not preserved between the immediate downstream and the
11474+
* immediate upstream. The operator always requests the default {@link #bufferSize()} amount first, then after
11475+
* every 75% of that amount delivered, another 75% of this default value. If preserving the request amounts
11476+
* is to be preferred over potential excess scheduler infrastructure use, consider applying
11477+
* {@link #delay(long, TimeUnit, Scheduler, boolean)} with zero time instead.
11478+
* </dd>
1146311479
* <dt><b>Scheduler:</b></dt>
1146411480
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
1146511481
* </dl>
@@ -11501,8 +11517,16 @@ public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError) {
1150111517
* <dd>This operator honors backpressure from downstream and expects it from the source {@code Publisher}. Violating this
1150211518
* expectation will lead to {@code MissingBackpressureException}. This is the most common operator where the exception
1150311519
* pops up; look for sources up the chain that don't support backpressure,
11504-
* such as {@code interval}, {@code timer}, {code PublishSubject} or {@code BehaviorSubject} and apply any
11505-
* of the {@code onBackpressureXXX} operators <strong>before</strong> applying {@code observeOn} itself.</dd>
11520+
* such as {@link #interval(long, TimeUnit)}, {@link #timer(long, TimeUnit)},
11521+
* {@link io.reactivex.rxjava3.processors.PublishProcessor PublishProcessor} or
11522+
* {@link io.reactivex.rxjava3.processors.BehaviorProcessor BehaviorProcessor} and apply any
11523+
* of the {@code onBackpressureXXX} operators <strong>before</strong> applying {@code observeOn} itself.
11524+
* Note also that request amounts are not preserved between the immediate downstream and the
11525+
* immediate upstream. The operator always requests the specified {@code bufferSize} amount first, then after
11526+
* every 75% of that amount delivered, another 75% of this specified value. If preserving the request amounts
11527+
* is to be preferred over potential excess scheduler infrastructure use, consider applying
11528+
* {@link #delay(long, TimeUnit, Scheduler, boolean)} with zero time instead.
11529+
* </dd>
1150611530
* <dt><b>Scheduler:</b></dt>
1150711531
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
1150811532
* </dl>

0 commit comments

Comments
 (0)