Class OperatorSwitchIfEmpty.ParentSubscriber<T>

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

static final class OperatorSwitchIfEmpty.ParentSubscriber<T> extends Subscriber<T>
  • Field Details

  • Constructor Details

  • Method Details

    • setProducer

      public void setProducer(Producer producer)
      Description copied from class: Subscriber
      If other subscriber is set (by calling constructor Subscriber(Subscriber) or Subscriber(Subscriber, boolean)) then this method calls setProducer on the other subscriber. If the other subscriber is not set and no requests have been made to this subscriber then p.request(Long.MAX_VALUE) is called. If the other subscriber is not set and some requests have been made to this subscriber then p.request(n) is called where n is the accumulated requests to this subscriber.
      Overrides:
      setProducer in class Subscriber<T>
      Parameters:
      producer - producer to be used by this subscriber or the other subscriber (or recursively its other subscriber) to make requests from
    • 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).

    • subscribeToAlternate

      private void subscribeToAlternate()
    • 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().

      Parameters:
      e - the exception encountered by the Observable
    • 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).

      Parameters:
      t - the item emitted by the Observable