Skip to content

Commit

Permalink
Clarify contracts of CompositeSubscription in its javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zinnatullin committed Oct 17, 2015
1 parent 1fd245b commit 4c33811
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/rx/subscriptions/CompositeSubscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

/**
* Subscription that represents a group of Subscriptions that are unsubscribed together.
* <p>
* All methods of this class are thread-safe.
*/
public final class CompositeSubscription implements Subscription {

Expand Down Expand Up @@ -98,8 +100,8 @@ public void remove(final Subscription s) {

/**
* Unsubscribes any subscriptions that are currently part of this {@code CompositeSubscription} and remove
* them from the {@code CompositeSubscription} so that the {@code CompositeSubscription} is empty and in
* an unoperative state.
* them from the {@code CompositeSubscription} so that the {@code CompositeSubscription} is empty and
* able to manage new subscriptions.
*/
public void clear() {
if (!unsubscribed) {
Expand All @@ -116,6 +118,11 @@ public void clear() {
}
}

/**
* Unsubscribes itself and all inner subscriptions.
* <p>After call of this method, new {@code Subscription}s added to {@link CompositeSubscription}
* will be unsubscribed immediately.
*/
@Override
public void unsubscribe() {
if (!unsubscribed) {
Expand Down

0 comments on commit 4c33811

Please sign in to comment.