RxJava



rx.subscriptions
Class BooleanSubscription

java.lang.Object
  extended by rx.subscriptions.BooleanSubscription
All Implemented Interfaces:
Subscription

public class BooleanSubscription
extends java.lang.Object
implements Subscription

Subscription that can be checked for status such as in a loop inside an Observable to exit the loop if unsubscribed.

See Also:
Rx.Net equivalent BooleanDisposable

Constructor Summary
BooleanSubscription()
           
 
Method Summary
 boolean isUnsubscribed()
           
 void unsubscribe()
          Stop receiving notifications on the Observer that was registered when this Subscription was received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanSubscription

public BooleanSubscription()
Method Detail

isUnsubscribed

public boolean isUnsubscribed()

unsubscribe

public void unsubscribe()
Description copied from interface: Subscription
Stop receiving notifications on the Observer that was registered when this Subscription was received.

This allows unregistering an Observer before it has finished receiving all events (ie. before onCompleted is called).

Specified by:
unsubscribe in interface Subscription