Change the license to GPL v3 to be compatible with Apache License 2.0.
This commit is contained in:
1 parent
f0212ea4eb
commit
d3ad805ad3
331 files changed
+12761
-1878
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package rx.subscriptions;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import rx.Observable;
|
||||
import rx.Subscription;
|
||||
|
||||
/**
|
||||
* Subscription that can be checked for status such as in a loop inside an {@link Observable} to exit the loop if unsubscribed.
|
||||
*
|
||||
* @see Rx.Net equivalent BooleanDisposable at http://msdn.microsoft.com/en-us/library/system.reactive.disposables.booleandisposable(v=vs.103).aspx
|
||||
*/
|
||||
public class BooleanSubscription implements Subscription {
|
||||
|
||||
private final AtomicBoolean unsubscribed = new AtomicBoolean(false);
|
||||
|
||||
public boolean isUnsubscribed() {
|
||||
return unsubscribed.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsubscribe() {
|
||||
unsubscribed.set(true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user