File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -4774,13 +4774,21 @@ public final Observable<T> doOnTerminate(final Action0 onTerminate) {
4774
4774
}
4775
4775
4776
4776
/**
4777
- * Modifies the source {@code Observable} so that it invokes the given action when it is unsubscribed from
4778
- * its subscribers. Each un-subscription will result in an invocation of the given action except when the
4779
- * source {@code Observable} is reference counted, in which case the source {@code Observable} will invoke
4780
- * the given action for the very last un-subscription.
4777
+ * Calls the unsubscribe {@code Action0} if the downstream unsubscribes the sequence.
4778
+ * <p>
4779
+ * The action is shared between subscriptions and thus may be called concurrently from multiple
4780
+ * threads; the action must be thread safe.
4781
+ * <p>
4782
+ * If the action throws a runtime exception, that exception is rethrown by the {@code unsubscribe()} call,
4783
+ * sometimes as a {@code CompositeException} if there were multiple exceptions along the way.
4784
+ * <p>
4785
+ * Note that terminal events trigger the action unless the {@code Observable} is subscribed to via {@code unsafeSubscribe()}.
4781
4786
* <p>
4782
4787
* <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnUnsubscribe.png" alt="">
4783
4788
* <dl>
4789
+ * <dt><b>Backpressure:</b></dt>
4790
+ * <dd>{@code doOnUnsubscribe} does not interact with backpressure requests or value delivery; backpressure
4791
+ * behavior is preserved between its upstream and its downstream.</dd>
4784
4792
* <dt><b>Scheduler:</b></dt>
4785
4793
* <dd>{@code doOnUnsubscribe} does not operate by default on a particular {@link Scheduler}.</dd>
4786
4794
* </dl>
You can’t perform that action at this time.
0 commit comments