Skip to content

Commit

Permalink
1.x: fix SafeSubscriber documentation regarding unsubscribe
Browse files Browse the repository at this point in the history
The documentation was wrong in two points: unsubscription doesn't call
onCompleted and unsubscription doesn't directly prevent delivery of
onXXX events since the implementation doesn't even check isUnsubscribed:
(it is the responsibility of the upstream to do that).
  • Loading branch information
akarnokd committed Nov 9, 2015
1 parent 3e2b3b1 commit d153d71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/rx/observers/SafeSubscriber.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
* <ul>
* <li>Allows only single execution of either {@code onError} or {@code onCompleted}.</li>
* <li>Ensures that once an {@code onCompleted} or {@code onError} is performed, no further calls can be executed</li>
* <li>If {@code unsubscribe} is called, calls {@code onCompleted} and forbids any further {@code onNext} calls.</li>
* <li>If {@code unsubscribe} is called, the upstream {@code Observable} is notified and the event delivery will be stopped in a
* best effort manner (i.e., further onXXX calls may still slip through).</li>
* <li>When {@code onError} or {@code onCompleted} occur, unsubscribes from the {@code Observable} (if executing asynchronously).</li>
* </ul>
* {@code SafeSubscriber} will not synchronize {@code onNext} execution. Use {@link SerializedSubscriber} to do
Expand Down

0 comments on commit d153d71

Please sign in to comment.