-
- All Implemented Interfaces:
-
com.tds.common.reactor.Observer
,com.tds.common.reactor.Subscription
public abstract class Subscriber<T> implements Observer<T>, Subscription
-
-
Method Summary
Modifier and Type Method Description void
setProducer(Producer p)
final void
add(Subscription s)
void
onStart()
This method is invoked when the Subscriber and Observable have been connected but the Observable hasnot yet begun to emit items or send notifications to the Subscriber. final void
unsubscribe()
Stops the receipt of notifications on the Subscriber that was registered when this Subscriptionwas received. final boolean
isUnsubscribed()
Indicates whether this Subscriber has unsubscribed from its list of subscriptions. -
-
Method Detail
-
setProducer
void setProducer(Producer p)
-
add
final void add(Subscription s)
-
onStart
void onStart()
This method is invoked when the Subscriber and Observable have been connected but the Observable hasnot yet begun to emit items or send notifications to the Subscriber. Override this method to add anyuseful initialization to your subscription, for instance to initiate backpressure.
-
unsubscribe
final 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).
-
isUnsubscribed
final boolean isUnsubscribed()
Indicates whether this Subscriber has unsubscribed from its list of subscriptions.
-
-
-
-