public final class BooleanSubscription extends java.lang.Object implements Subscription
Observable
to exit the loop
if unsubscribed.Constructor and Description |
---|
BooleanSubscription() |
Modifier and Type | Method and Description |
---|---|
static BooleanSubscription |
create()
Creates a
BooleanSubscription without unsubscribe behavior. |
static BooleanSubscription |
create(Action0 onUnsubscribe)
Creates a
BooleanSubscription with a specified function to invoke upon unsubscribe. |
boolean |
isUnsubscribed()
Indicates whether this
Subscription is currently unsubscribed. |
void |
unsubscribe()
Stops the receipt of notifications on the
Subscriber that was registered when this Subscription
was received. |
public static BooleanSubscription create()
BooleanSubscription
without unsubscribe behavior.BooleanSubscription
public static BooleanSubscription create(Action0 onUnsubscribe)
BooleanSubscription
with a specified function to invoke upon unsubscribe.onUnsubscribe
- an Action0
to invoke upon unsubscribeBooleanSubscription
public boolean isUnsubscribed()
Subscription
Subscription
is currently unsubscribed.isUnsubscribed
in interface Subscription
true
if this Subscription
is currently unsubscribed, false
otherwisepublic void unsubscribe()
Subscription
Subscriber
that was registered when this Subscription
was received.
This allows deregistering an Subscriber
before it has finished receiving all events (i.e. before
onCompleted is called).
unsubscribe
in interface Subscription