public final class RefCountSubscription extends java.lang.Object implements Subscription
Constructor and Description |
---|
RefCountSubscription(Subscription s)
Creates a
RefCountSubscription by wrapping the given non-null Subscription . |
Modifier and Type | Method and Description |
---|---|
Subscription |
get()
Returns a new sub-subscription
|
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 RefCountSubscription(Subscription s)
RefCountSubscription
by wrapping the given non-null Subscription
.s
- the Subscription
to wrapjava.lang.IllegalArgumentException
- if s
is null
public Subscription get()
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