Skip to content

Commit

Permalink
Fix terminology of cancel/dispose in the JavaDocs (#6199)
Browse files Browse the repository at this point in the history
* #6196 Fixing terminology of cancel/dispose in the JavaDocs for Completable.

* #6196 Fixing terminology of cancel/dispose in the JavaDocs for Maybe.

* #6196 Fixing terminology of cancel/dispose in the JavaDocs for Observable.

* #6196 Fixing terminology of cancel/dispose in the JavaDocs for Single.

* #6196 Switching from subscribers to observers in `Completable.fromFuture()` JavaDoc
  • Loading branch information
luis-cortes authored and akarnokd committed Sep 4, 2018
1 parent fbbae6c commit 59454ea
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 92 deletions.
44 changes: 22 additions & 22 deletions src/main/java/io/reactivex/Completable.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
* d.dispose();
* </code></pre>
* <p>
* Note that by design, subscriptions via {@link #subscribe(CompletableObserver)} can't be cancelled/disposed
* Note that by design, subscriptions via {@link #subscribe(CompletableObserver)} can't be disposed
* from the outside (hence the
* {@code void} return of the {@link #subscribe(CompletableObserver)} method) and it is the
* responsibility of the implementor of the {@code CompletableObserver} to allow this to happen.
Expand All @@ -105,7 +105,7 @@
public abstract class Completable implements CompletableSource {
/**
* Returns a Completable which terminates as soon as one of the source Completables
* terminates (normally or with an error) and cancels all other Completables.
* terminates (normally or with an error) and disposes all other Completables.
* <p>
* <img width="640" height="518" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.ambArray.png" alt="">
* <dl>
Expand Down Expand Up @@ -133,7 +133,7 @@ public static Completable ambArray(final CompletableSource... sources) {

/**
* Returns a Completable which terminates as soon as one of the source Completables
* terminates (normally or with an error) and cancels all other Completables.
* terminates (normally or with an error) and disposes all other Completables.
* <p>
* <img width="640" height="518" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.amb.png" alt="">
* <dl>
Expand Down Expand Up @@ -306,7 +306,7 @@ public static Completable create(CompletableOnSubscribe source) {
/**
* Constructs a Completable instance by wrapping the given source callback
* <strong>without any safeguards; you should manage the lifecycle and response
* to downstream cancellation/dispose</strong>.
* to downstream disposal</strong>.
* <p>
* <img width="640" height="260" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.unsafeCreate.png" alt="">
* <dl>
Expand Down Expand Up @@ -446,7 +446,7 @@ public static Completable fromCallable(final Callable<?> callable) {
* <p>
* <img width="640" height="628" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromFuture.png" alt="">
* <p>
* Note that cancellation from any of the subscribers to this Completable will cancel the future.
* Note that if any of the observers to this Completable call dispose, this Completable will cancel the future.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code fromFuture} does not operate by default on a particular {@link Scheduler}.</dd>
Expand Down Expand Up @@ -594,13 +594,13 @@ public static <T> Completable fromSingle(final SingleSource<T> single) {
* <dd>{@code mergeArray} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled.
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are disposed.
* If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the
* first one's error or, depending on the concurrency of the sources, may terminate with a
* {@code CompositeException} containing two or more of the various error signals.
* {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via
* {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s
* signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a
* signaled by source(s) after the returned {@code Completable} has been disposed or terminated with a
* (composite) error will be sent to the same global error handler.
* Use {@link #mergeArrayDelayError(CompletableSource...)} to merge sources and terminate only when all source {@code CompletableSource}s
* have completed or failed with an error.
Expand Down Expand Up @@ -634,13 +634,13 @@ public static Completable mergeArray(CompletableSource... sources) {
* <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled.
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are disposed.
* If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the
* first one's error or, depending on the concurrency of the sources, may terminate with a
* {@code CompositeException} containing two or more of the various error signals.
* {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via
* {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s
* signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a
* signaled by source(s) after the returned {@code Completable} has been disposed or terminated with a
* (composite) error will be sent to the same global error handler.
* Use {@link #mergeDelayError(Iterable)} to merge sources and terminate only when all source {@code CompletableSource}s
* have completed or failed with an error.
Expand Down Expand Up @@ -671,13 +671,13 @@ public static Completable merge(Iterable<? extends CompletableSource> sources) {
* <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled.
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are disposed.
* If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the
* first one's error or, depending on the concurrency of the sources, may terminate with a
* {@code CompositeException} containing two or more of the various error signals.
* {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via
* {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s
* signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a
* signaled by source(s) after the returned {@code Completable} has been disposed or terminated with a
* (composite) error will be sent to the same global error handler.
* Use {@link #mergeDelayError(Publisher)} to merge sources and terminate only when all source {@code CompletableSource}s
* have completed or failed with an error.
Expand Down Expand Up @@ -708,13 +708,13 @@ public static Completable merge(Publisher<? extends CompletableSource> sources)
* <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd>If any of the source {@code CompletableSource}s signal a {@code Throwable} via {@code onError}, the resulting
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are cancelled.
* {@code Completable} terminates with that {@code Throwable} and all other source {@code CompletableSource}s are disposed.
* If more than one {@code CompletableSource} signals an error, the resulting {@code Completable} may terminate with the
* first one's error or, depending on the concurrency of the sources, may terminate with a
* {@code CompositeException} containing two or more of the various error signals.
* {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via
* {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s
* signaled by source(s) after the returned {@code Completable} has been cancelled or terminated with a
* signaled by source(s) after the returned {@code Completable} has been disposed or terminated with a
* (composite) error will be sent to the same global error handler.
* Use {@link #mergeDelayError(Publisher, int)} to merge sources and terminate only when all source {@code CompletableSource}s
* have completed or failed with an error.
Expand Down Expand Up @@ -952,7 +952,7 @@ public static <R> Completable using(Callable<R> resourceSupplier,
* <p>
* <img width="640" height="332" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.using.b.png" alt="">
* <p>
* If this overload performs a lazy cancellation after the terminal event is emitted.
* If this overload performs a lazy disposal after the terminal event is emitted.
* Exceptions thrown at this time will be delivered to RxJavaPlugins only.
* <dl>
* <dt><b>Scheduler:</b></dt>
Expand Down Expand Up @@ -1585,7 +1585,7 @@ public final Completable doAfterTerminate(final Action onAfterTerminate) {
* <dd>{@code doFinally} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.1 - experimental
* @param onFinally the action called when this Completable terminates or gets cancelled
* @param onFinally the action called when this Completable terminates or gets disposed
* @return the new Completable instance
* @since 2.1
*/
Expand Down Expand Up @@ -1852,7 +1852,7 @@ public final Completable onTerminateDetach() {
}

/**
* Returns a Completable that repeatedly subscribes to this Completable until cancelled.
* Returns a Completable that repeatedly subscribes to this Completable until disposed.
* <p>
* <img width="640" height="373" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.repeat.png" alt="">
* <dl>
Expand Down Expand Up @@ -2155,15 +2155,15 @@ public final Completable hide() {
}

/**
* Subscribes to this CompletableConsumable and returns a Disposable which can be used to cancel
* Subscribes to this CompletableConsumable and returns a Disposable which can be used to dispose
* the subscription.
* <p>
* <img width="640" height="352" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.subscribe.png" alt="">
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* @return the Disposable that allows cancelling the subscription
* @return the Disposable that allows disposing the subscription
*/
@SchedulerSupport(SchedulerSupport.NONE)
public final Disposable subscribe() {
Expand Down Expand Up @@ -2245,7 +2245,7 @@ public final <E extends CompletableObserver> E subscribeWith(E observer) {
* </dl>
* @param onComplete the runnable that is called if the Completable completes normally
* @param onError the consumer that is called if this Completable emits an error
* @return the Disposable that can be used for cancelling the subscription asynchronously
* @return the Disposable that can be used for disposing the subscription asynchronously
* @throws NullPointerException if either callback is null
*/
@CheckReturnValue
Expand Down Expand Up @@ -2273,7 +2273,7 @@ public final Disposable subscribe(final Action onComplete, final Consumer<? supe
* <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* @param onComplete the runnable called when this Completable completes normally
* @return the Disposable that allows cancelling the subscription
* @return the Disposable that allows disposing the subscription
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
Expand Down Expand Up @@ -2583,15 +2583,15 @@ public final <T> Single<T> toSingleDefault(final T completionValue) {
}

/**
* Returns a Completable which makes sure when a subscriber cancels the subscription, the
* Returns a Completable which makes sure when a subscriber disposes the subscription, the
* dispose is called on the specified scheduler.
* <p>
* <img width="640" height="716" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.unsubscribeOn.png" alt="">
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code unsubscribeOn} calls dispose() of the upstream on the {@link Scheduler} you specify.</dd>
* </dl>
* @param scheduler the target scheduler where to execute the cancellation
* @param scheduler the target scheduler where to execute the disposing
* @return the new Completable instance
* @throws NullPointerException if scheduler is null
*/
Expand Down
Loading

0 comments on commit 59454ea

Please sign in to comment.