public final class SerialSubscription extends java.lang.Object implements Subscription
Constructor and Description |
---|
SerialSubscription() |
Modifier and Type | Method and Description |
---|---|
Subscription |
get()
Retrieves the current
Subscription that is being represented by this SerialSubscription . |
boolean |
isUnsubscribed()
Indicates whether this
Subscription is currently unsubscribed. |
void |
set(Subscription s)
Swaps out the old
Subscription for the specified Subscription . |
void |
unsubscribe()
Stops the receipt of notifications on the
Subscriber that was registered when this Subscription
was received. |
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 unregistering an Subscriber
before it has finished receiving all events (i.e. before
onCompleted is called).
unsubscribe
in interface Subscription
public void set(Subscription s)
Subscription
for the specified Subscription
.s
- the new Subscription
to swap injava.lang.IllegalArgumentException
- if s
is null
public Subscription get()
Subscription
that is being represented by this SerialSubscription
.Subscription
that is being represented by this SerialSubscription