Skip to content

Commit 01232cb

Browse files
authored
2.x: fix wording of toList, fix a/an in subscribeOn (#5465)
1 parent 6c115a4 commit 01232cb

File tree

2 files changed

+34
-28
lines changed

2 files changed

+34
-28
lines changed

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

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5573,7 +5573,7 @@ public final T blockingSingle(T defaultItem) {
55735573
* {@link java.lang.IllegalArgumentException}. If the {@link Flowable} is empty, {@link java.util.concurrent.Future}
55745574
* will receive an {@link java.util.NoSuchElementException}.
55755575
* <p>
5576-
* If the {@code Flowable} may emit more than one item, use {@code Flowable.toList().toBlocking().toFuture()}.
5576+
* If the {@code Flowable} may emit more than one item, use {@code Flowable.toList().toFuture()}.
55775577
* <p>
55785578
* <img width="640" height="395" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/B.toFuture.png" alt="">
55795579
* <dl>
@@ -13056,7 +13056,7 @@ public final <E extends Subscriber<? super T>> E subscribeWith(E subscriber) {
1305613056
* <p>
1305713057
* If there is a {@link #create(FlowableOnSubscribe, BackpressureStrategy)} type source up in the
1305813058
* chain, it is recommended to use {@code subscribeOn(scheduler, false)} instead
13059-
* to avoid same-pool deadlock because requests may pile up behind a eager/blocking emitter.
13059+
* to avoid same-pool deadlock because requests may pile up behind an eager/blocking emitter.
1306013060
* <p>
1306113061
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/subscribeOn.png" alt="">
1306213062
* <dl>
@@ -13090,7 +13090,7 @@ public final Flowable<T> subscribeOn(@NonNull Scheduler scheduler) {
1309013090
* <p>
1309113091
* If there is a {@link #create(FlowableOnSubscribe, BackpressureStrategy)} type source up in the
1309213092
* chain, it is recommended to have {@code requestOn} false to avoid same-pool deadlock
13093-
* because requests may pile up behind a eager/blocking emitter.
13093+
* because requests may pile up behind an eager/blocking emitter.
1309413094
* <p>
1309513095
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/subscribeOn.png" alt="">
1309613096
* <dl>
@@ -14574,8 +14574,8 @@ public final <R> R to(Function<? super Flowable<T>, R> converter) {
1457414574
}
1457514575

1457614576
/**
14577-
* Returns a Single that emits a single item, a list composed of all the items emitted by the source
14578-
* Publisher.
14577+
* Returns a Single that emits a single item, a list composed of all the items emitted by the
14578+
* finite upstream source Publisher.
1457914579
* <p>
1458014580
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.png" alt="">
1458114581
* <p>
@@ -14585,8 +14585,9 @@ public final <R> R to(Function<? super Flowable<T>, R> converter) {
1458514585
* function once, passing it the entire list, by calling the Publisher's {@code toList} method prior to
1458614586
* calling its {@link #subscribe} method.
1458714587
* <p>
14588-
* Be careful not to use this operator on Publishers that emit infinite or very large numbers of items, as
14589-
* you do not have the option to cancel.
14588+
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulated list to
14589+
* be emitted. Sources that are infinite and never complete will never emit anything through this
14590+
* operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
1459014591
* <dl>
1459114592
* <dt><b>Backpressure:</b></dt>
1459214593
* <dd>The operator honors backpressure from downstream and consumes the source {@code Publisher} in an
@@ -14607,8 +14608,8 @@ public final Single<List<T>> toList() {
1460714608
}
1460814609

1460914610
/**
14610-
* Returns a Single that emits a single item, a list composed of all the items emitted by the source
14611-
* Publisher.
14611+
* Returns a Single that emits a single item, a list composed of all the items emitted by the
14612+
* finite source Publisher.
1461214613
* <p>
1461314614
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.png" alt="">
1461414615
* <p>
@@ -14618,8 +14619,9 @@ public final Single<List<T>> toList() {
1461814619
* function once, passing it the entire list, by calling the Publisher's {@code toList} method prior to
1461914620
* calling its {@link #subscribe} method.
1462014621
* <p>
14621-
* Be careful not to use this operator on Publishers that emit infinite or very large numbers of items, as
14622-
* you do not have the option to cancel.
14622+
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulated list to
14623+
* be emitted. Sources that are infinite and never complete will never emit anything through this
14624+
* operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
1462314625
* <dl>
1462414626
* <dt><b>Backpressure:</b></dt>
1462514627
* <dd>The operator honors backpressure from downstream and consumes the source {@code Publisher} in an
@@ -14643,8 +14645,8 @@ public final Single<List<T>> toList(final int capacityHint) {
1464314645
}
1464414646

1464514647
/**
14646-
* Returns a Single that emits a single item, a list composed of all the items emitted by the source
14647-
* Publisher.
14648+
* Returns a Single that emits a single item, a list composed of all the items emitted by the
14649+
* finite source Publisher.
1464814650
* <p>
1464914651
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.png" alt="">
1465014652
* <p>
@@ -14654,8 +14656,9 @@ public final Single<List<T>> toList(final int capacityHint) {
1465414656
* function once, passing it the entire list, by calling the Publisher's {@code toList} method prior to
1465514657
* calling its {@link #subscribe} method.
1465614658
* <p>
14657-
* Be careful not to use this operator on Publishers that emit infinite or very large numbers of items, as
14658-
* you do not have the option to cancel.
14659+
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulated collection to
14660+
* be emitted. Sources that are infinite and never complete will never emit anything through this
14661+
* operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
1465914662
* <dl>
1466014663
* <dt><b>Backpressure:</b></dt>
1466114664
* <dd>The operator honors backpressure from downstream and consumes the source {@code Publisher} in an

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

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,7 +5086,7 @@ public final T blockingSingle(T defaultItem) {
50865086
* {@link java.lang.IllegalArgumentException}. If the {@link Observable} is empty, {@link java.util.concurrent.Future}
50875087
* will receive an {@link java.util.NoSuchElementException}.
50885088
* <p>
5089-
* If the {@code Observable} may emit more than one item, use {@code Observable.toList().toBlocking().toFuture()}.
5089+
* If the {@code Observable} may emit more than one item, use {@code Observable.toList().toFuture()}.
50905090
* <p>
50915091
* <img width="640" height="395" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/B.toFuture.png" alt="">
50925092
* <dl>
@@ -12294,8 +12294,8 @@ public final <R> R to(Function<? super Observable<T>, R> converter) {
1229412294
}
1229512295

1229612296
/**
12297-
* Returns a Single that emits a single item, a list composed of all the items emitted by the source
12298-
* ObservableSource.
12297+
* Returns a Single that emits a single item, a list composed of all the items emitted by the
12298+
* finite source ObservableSource.
1229912299
* <p>
1230012300
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.2.png" alt="">
1230112301
* <p>
@@ -12305,8 +12305,9 @@ public final <R> R to(Function<? super Observable<T>, R> converter) {
1230512305
* function once, passing it the entire list, by calling the ObservableSource's {@code toList} method prior to
1230612306
* calling its {@link #subscribe} method.
1230712307
* <p>
12308-
* Be careful not to use this operator on ObservableSources that emit infinite or very large numbers of items, as
12309-
* you do not have the option to dispose.
12308+
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulated list to
12309+
* be emitted. Sources that are infinite and never complete will never emit anything through this
12310+
* operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
1231012311
* <dl>
1231112312
* <dt><b>Scheduler:</b></dt>
1231212313
* <dd>{@code toList} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -12323,8 +12324,8 @@ public final Single<List<T>> toList() {
1232312324
}
1232412325

1232512326
/**
12326-
* Returns a Single that emits a single item, a list composed of all the items emitted by the source
12327-
* ObservableSource.
12327+
* Returns a Single that emits a single item, a list composed of all the items emitted by the
12328+
* finite source ObservableSource.
1232812329
* <p>
1232912330
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.2.png" alt="">
1233012331
* <p>
@@ -12334,8 +12335,9 @@ public final Single<List<T>> toList() {
1233412335
* function once, passing it the entire list, by calling the ObservableSource's {@code toList} method prior to
1233512336
* calling its {@link #subscribe} method.
1233612337
* <p>
12337-
* Be careful not to use this operator on ObservableSources that emit infinite or very large numbers of items, as
12338-
* you do not have the option to dispose.
12338+
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulated list to
12339+
* be emitted. Sources that are infinite and never complete will never emit anything through this
12340+
* operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
1233912341
* <dl>
1234012342
* <dt><b>Scheduler:</b></dt>
1234112343
* <dd>{@code toList} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -12355,8 +12357,8 @@ public final Single<List<T>> toList(final int capacityHint) {
1235512357
}
1235612358

1235712359
/**
12358-
* Returns a Single that emits a single item, a list composed of all the items emitted by the source
12359-
* ObservableSource.
12360+
* Returns a Single that emits a single item, a list composed of all the items emitted by the
12361+
* finite source ObservableSource.
1236012362
* <p>
1236112363
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.2.png" alt="">
1236212364
* <p>
@@ -12366,8 +12368,9 @@ public final Single<List<T>> toList(final int capacityHint) {
1236612368
* function once, passing it the entire list, by calling the ObservableSource's {@code toList} method prior to
1236712369
* calling its {@link #subscribe} method.
1236812370
* <p>
12369-
* Be careful not to use this operator on ObservableSources that emit infinite or very large numbers of items, as
12370-
* you do not have the option to dispose.
12371+
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulated collection to
12372+
* be emitted. Sources that are infinite and never complete will never emit anything through this
12373+
* operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
1237112374
* <dl>
1237212375
* <dt><b>Scheduler:</b></dt>
1237312376
* <dd>{@code toList} does not operate by default on a particular {@link Scheduler}.</dd>

0 commit comments

Comments
 (0)