Skip to content

Commit 4c33811

Browse files
Clarify contracts of CompositeSubscription in its javadoc
1 parent 1fd245b commit 4c33811

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main/java/rx/subscriptions/CompositeSubscription.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
/**
2929
* Subscription that represents a group of Subscriptions that are unsubscribed together.
30+
* <p>
31+
* All methods of this class are thread-safe.
3032
*/
3133
public final class CompositeSubscription implements Subscription {
3234

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

99101
/**
100102
* Unsubscribes any subscriptions that are currently part of this {@code CompositeSubscription} and remove
101-
* them from the {@code CompositeSubscription} so that the {@code CompositeSubscription} is empty and in
102-
* an unoperative state.
103+
* them from the {@code CompositeSubscription} so that the {@code CompositeSubscription} is empty and
104+
* able to manage new subscriptions.
103105
*/
104106
public void clear() {
105107
if (!unsubscribed) {
@@ -116,6 +118,11 @@ public void clear() {
116118
}
117119
}
118120

121+
/**
122+
* Unsubscribes itself and all inner subscriptions.
123+
* <p>After call of this method, new {@code Subscription}s added to {@link CompositeSubscription}
124+
* will be unsubscribed immediately.
125+
*/
119126
@Override
120127
public void unsubscribe() {
121128
if (!unsubscribed) {

0 commit comments

Comments
 (0)