Class OperatorPublish.PublishSubscriber<T>

java.lang.Object
rx.Subscriber<T>
rx.internal.operators.OperatorPublish.PublishSubscriber<T>
All Implemented Interfaces:
Observer<T>, Subscription
Enclosing class:
OperatorPublish<T>

static final class OperatorPublish.PublishSubscriber<T> extends Subscriber<T> implements Subscription
  • Field Details

  • Constructor Details

  • Method Details

    • init

      void init()
      Should be called after the constructor finished to setup nulling-out the current reference.
    • onStart

      public void onStart()
      Description copied from class: Subscriber
      This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber. Override this method to add any useful initialization to your subscription, for instance to initiate backpressure.
      Overrides:
      onStart in class Subscriber<T>
    • onNext

      public void onNext(T t)
      Description copied from interface: Observer
      Provides the Observer with a new item to observe.

      The Observable may call this method 0 or more times.

      The Observable will not call this method again after it calls either Observer.onCompleted() or Observer.onError(java.lang.Throwable).

      Specified by:
      onNext in interface Observer<T>
      Parameters:
      t - the item emitted by the Observable
    • onError

      public void onError(Throwable e)
      Description copied from interface: Observer
      Notifies the Observer that the Observable has experienced an error condition.

      If the Observable calls this method, it will not thereafter call Observer.onNext(T) or Observer.onCompleted().

      Specified by:
      onError in interface Observer<T>
      Parameters:
      e - the exception encountered by the Observable
    • onCompleted

      public void onCompleted()
      Description copied from interface: Observer
      Notifies the Observer that the Observable has finished sending push-based notifications.

      The Observable will not call this method if it calls Observer.onError(java.lang.Throwable).

      Specified by:
      onCompleted in interface Observer<T>
    • add

      boolean add(OperatorPublish.InnerProducer<T> producer)
      Atomically try adding a new InnerProducer to this Subscriber or return false if this Subscriber was terminated.
      Parameters:
      producer - the producer to add
      Returns:
      true if succeeded, false otherwise
    • remove

      void remove(OperatorPublish.InnerProducer<T> producer)
      Atomically removes the given producer from the producers array.
      Parameters:
      producer - the producer to remove
    • checkTerminated

      boolean checkTerminated(Object term, boolean empty)
      Perform termination actions in case the source has terminated in some way and the queue has also become empty.
      Parameters:
      term - the terminal event (a NotificationLite.error or completed)
      empty - set to true if the queue is empty
      Returns:
      true if there is indeed a terminal condition
    • dispatch

      void dispatch()
      The common serialization point of events arriving from upstream and child-subscribers requesting more.