Class OnSubscribeDetach.DetachSubscriber<T>

  • Type Parameters:
    T - the value type
    All Implemented Interfaces:
    Observer<T>, Subscription
    Enclosing class:
    OnSubscribeDetach<T>

    static final class OnSubscribeDetach.DetachSubscriber<T>
    extends Subscriber<T>
    The parent subscriber that forwards events and cleans up on a terminal state.
    • Field Detail

      • actual

        final java.util.concurrent.atomic.AtomicReference<Subscriber<? super T>> actual
      • producer

        final java.util.concurrent.atomic.AtomicReference<Producer> producer
      • requested

        final java.util.concurrent.atomic.AtomicLong requested
    • Constructor Detail

      • DetachSubscriber

        public DetachSubscriber​(Subscriber<? super T> actual)
    • Method Detail

      • onError

        public void onError​(java.lang.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
      • innerRequest

        void innerRequest​(long n)
      • setProducer

        public void setProducer​(Producer p)
        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:
        p - producer to be used by this subscriber or the other subscriber (or recursively its other subscriber) to make requests from
      • innerUnsubscribe

        void innerUnsubscribe()