Package rx.subscriptions
Class MultipleAssignmentSubscription
java.lang.Object
rx.subscriptions.MultipleAssignmentSubscription
- All Implemented Interfaces:
Subscription
Subscription that can be checked for status such as in a loop inside an
Observable
to exit the loop
if unsubscribed.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final AtomicReference
<MultipleAssignmentSubscription.State> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()
Gets the underlying subscription.boolean
Indicates whether thisSubscription
is currently unsubscribed.void
set
(Subscription s) Sets the underlying subscription.void
Stops the receipt of notifications on theSubscriber
that was registered when this Subscription was received.
-
Field Details
-
state
-
-
Constructor Details
-
MultipleAssignmentSubscription
public MultipleAssignmentSubscription()
-
-
Method Details
-
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
-
set
Sets the underlying subscription. If theMultipleAssignmentSubscription
is already unsubscribed, setting a new subscription causes the new subscription to also be immediately unsubscribed.- Parameters:
s
- theSubscription
to set- Throws:
IllegalArgumentException
- ifs
isnull
-
get
Gets the underlying subscription.- Returns:
- the
Subscription
that underlies theMultipleAssignmentSubscription
-