Top Description Fields Constructors Methods
rx.subscriptions

public final Class BooleanSubscription

extends Object
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription
Imports
java.util.concurrent.atomic.AtomicReference, rx.Observable, .Subscription, rx.functions.Action0

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

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicReference<Action0>
pack-priv static final Action0

Constructor Summary

AccessConstructor and Description
public
private

Method Summary

Modifier and TypeMethod and Description
public static BooleanSubscription

Returns:

the created BooleanSubscription
create
()

Creates a BooleanSubscription without unsubscribe behavior.

public static BooleanSubscription

Returns:

the created BooleanSubscription
create
(Action0
an Action0 to invoke upon unsubscribe
onUnsubscribe
)

Creates a BooleanSubscription with a specified function to invoke upon unsubscribe.

public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
public void
unsubscribe()

Implements rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

actionRefback to summary
pack-priv final AtomicReference<Action0> actionRef
EMPTY_ACTIONback to summary
pack-priv static final Action0 EMPTY_ACTION

Constructor Detail

BooleanSubscriptionback to summary
public BooleanSubscription()
BooleanSubscriptionback to summary
private BooleanSubscription(Action0 action)

Method Detail

createback to summary
public static BooleanSubscription create()

Creates a BooleanSubscription without unsubscribe behavior.

Returns:BooleanSubscription

the created BooleanSubscription

createback to summary
public static BooleanSubscription create(Action0 onUnsubscribe)

Creates a BooleanSubscription with a specified function to invoke upon unsubscribe.

Parameters
onUnsubscribe:Action0

an Action0 to invoke upon unsubscribe

Returns:BooleanSubscription

the created BooleanSubscription

isUnsubscribedback to summary
public boolean isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Doc from rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.

Returns:boolean

true if this Subscription is currently unsubscribed, false otherwise

Annotations
@Override
unsubscribeback to summary
public void unsubscribe()

Implements rx.Subscription.unsubscribe.

Doc from rx.Subscription.unsubscribe.

Stops the receipt of notifications on the 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).

Annotations
@Override