-
- All Implemented Interfaces:
-
com.tds.common.reactor.Subscription
public final class SerialSubscription implements Subscription
Represents a subscription whose underlying subscription can be swapped for another subscription which causes the previous underlying subscription to be unsubscribed.
-
-
Method Summary
Modifier and Type Method Description boolean
isUnsubscribed()
Indicates whether this {@code Subscription}
is currently unsubscribed.void
unsubscribe()
Stops the receipt of notifications on the Subscriber that was registered when this Subscriptionwas received. void
set(Subscription s)
Sets the underlying subscription. Subscription
get()
Gets the underlying subscription. -
-
Method Detail
-
isUnsubscribed
boolean isUnsubscribed()
Indicates whether this
{@code Subscription}
is currently unsubscribed.
-
unsubscribe
void unsubscribe()
Stops the receipt of notifications on the Subscriber that was registered when this Subscriptionwas received.
This allows deregistering an Subscriber before it has finished receiving all events (i.e. beforeonCompleted is called).
-
set
void set(Subscription s)
Sets the underlying subscription. If the
{@code MultipleAssignmentSubscription}
is already unsubscribed,setting a new subscription causes the new subscription to also be immediately unsubscribed.- Parameters:
s
- the Subscription to set
-
get
Subscription get()
Gets the underlying subscription.
-
-
-
-