Skip to content

Commit 54c281a

Browse files
RomanWuattierakarnokd
authored andcommitted
Fix Observable javadoc (#5944) (#5948)
* Replace `doOnCancel` by `doOnDispose`
1 parent 2770e4d commit 54c281a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,8 +1736,8 @@ public static <T> Observable<T> fromCallable(Callable<? extends T> supplier) {
17361736
* <p>
17371737
* <em>Important note:</em> This ObservableSource is blocking; you cannot dispose it.
17381738
* <p>
1739-
* Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the
1740-
* cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}.
1739+
* Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the
1740+
* cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}.
17411741
* <dl>
17421742
* <dt><b>Scheduler:</b></dt>
17431743
* <dd>{@code fromFuture} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -1767,8 +1767,8 @@ public static <T> Observable<T> fromFuture(Future<? extends T> future) {
17671767
* return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
17681768
* method.
17691769
* <p>
1770-
* Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the
1771-
* cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}.
1770+
* Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the
1771+
* cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}.
17721772
* <p>
17731773
* <em>Important note:</em> This ObservableSource is blocking; you cannot dispose it.
17741774
* <dl>
@@ -1805,8 +1805,8 @@ public static <T> Observable<T> fromFuture(Future<? extends T> future, long time
18051805
* return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
18061806
* method.
18071807
* <p>
1808-
* Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the
1809-
* cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}.
1808+
* Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the
1809+
* cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}.
18101810
* <p>
18111811
* <em>Important note:</em> This ObservableSource is blocking; you cannot dispose it.
18121812
* <dl>
@@ -1846,8 +1846,8 @@ public static <T> Observable<T> fromFuture(Future<? extends T> future, long time
18461846
* return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
18471847
* method.
18481848
* <p>
1849-
* Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the
1850-
* cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}.
1849+
* Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the
1850+
* cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}.
18511851
* <dl>
18521852
* <dt><b>Scheduler:</b></dt>
18531853
* <dd>You specify which {@link Scheduler} this operator will use.</dd>
@@ -7497,7 +7497,7 @@ public final Observable<T> delaySubscription(long delay, TimeUnit unit, Schedule
74977497
* returned Observable cancels the flow and terminates with that type of terminal event:
74987498
* <pre><code>
74997499
* Observable.just(createOnNext(1), createOnComplete(), createOnNext(2))
7500-
* .doOnCancel(() -&gt; System.out.println("Cancelled!"));
7500+
* .doOnDispose(() -&gt; System.out.println("Cancelled!"));
75017501
* .test()
75027502
* .assertResult(1);
75037503
* </code></pre>

0 commit comments

Comments
 (0)