Package rx.subscriptions
Class RefCountSubscription
java.lang.Object
rx.subscriptions.RefCountSubscription
- All Implemented Interfaces:
Subscription
Keeps track of the sub-subscriptions and unsubscribes the underlying subscription once all sub-subscriptions
have unsubscribed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
The individual sub-subscriptions.(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Subscription
(package private) static final RefCountSubscription.State
(package private) final AtomicReference
<RefCountSubscription.State> -
Constructor Summary
ConstructorsConstructorDescriptionCreates aRefCountSubscription
by wrapping the given non-nullSubscription
. -
Method Summary
Modifier and TypeMethodDescriptionget()
Returns a new sub-subscriptionboolean
Indicates whether thisSubscription
is currently unsubscribed.void
Stops the receipt of notifications on theSubscriber
that was registered when this Subscription was received.(package private) void
private void
-
Field Details
-
actual
-
EMPTY_STATE
-
state
-
-
Constructor Details
-
RefCountSubscription
Creates aRefCountSubscription
by wrapping the given non-nullSubscription
.- Parameters:
s
- theSubscription
to wrap- Throws:
IllegalArgumentException
- ifs
isnull
-
-
Method Details
-
get
Returns a new sub-subscription- Returns:
- a new sub-subscription.
-
isUnsubscribed
public boolean isUnsubscribed()Description copied from interface:Subscription
Indicates whether thisSubscription
is currently unsubscribed.- Specified by:
isUnsubscribed
in interfaceSubscription
- Returns:
true
if thisSubscription
is currently unsubscribed,false
otherwise
-
unsubscribe
public void unsubscribe()Description copied from interface:Subscription
Stops the receipt of notifications on theSubscriber
that was registered when this Subscription was received.This allows unregistering an
Subscriber
before it has finished receiving all events (i.e. before onCompleted is called).- Specified by:
unsubscribe
in interfaceSubscription
-
unsubscribeActualIfApplicable
-
unsubscribeAChild
void unsubscribeAChild()
-