Package 

Class Subscriber

  • All Implemented Interfaces:
    com.tds.common.reactor.Observer , com.tds.common.reactor.Subscription

    
    public abstract class Subscriber<T>
     implements Observer<T>, Subscription
                        
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Producer producer
    • 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.
      • Methods inherited from class com.tds.common.reactor.Observer

        onCompleted, onError, onNext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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.