Class PublishProcessor.PublishSubscription<T>

  • Type Parameters:
    T - the value type
    All Implemented Interfaces:
    java.io.Serializable, org.reactivestreams.Subscription
    Enclosing class:
    PublishProcessor<T>

    static final class PublishProcessor.PublishSubscription<@NonNull T>
    extends java.util.concurrent.atomic.AtomicLong
    implements org.reactivestreams.Subscription
    Wraps the actual subscriber, tracks its requests and makes cancellation to remove itself from the current subscribers array.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) org.reactivestreams.Subscriber<? super T> downstream
      The actual subscriber.
      (package private) PublishProcessor<T> parent
      The parent processor servicing this subscriber.
      private static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()  
      boolean isCancelled()  
      (package private) boolean isFull()  
      void onComplete()  
      void onError​(java.lang.Throwable t)  
      void onNext​(@NonNull T t)  
      void request​(long n)  
      • Methods inherited from class java.util.concurrent.atomic.AtomicLong

        accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
      • Methods inherited from class java.lang.Number

        byteValue, shortValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • downstream

        final org.reactivestreams.Subscriber<? super T> downstream
        The actual subscriber.
      • parent

        final PublishProcessor<T> parent
        The parent processor servicing this subscriber.
    • Constructor Detail

      • PublishSubscription

        PublishSubscription​(org.reactivestreams.Subscriber<? super @NonNull T> actual,
                            PublishProcessor<@NonNull T> parent)
        Constructs a PublishSubscriber, wraps the actual subscriber and the state.
        Parameters:
        actual - the actual subscriber
        parent - the parent PublishProcessor
    • Method Detail

      • onNext

        public void onNext​(@NonNull T t)
      • onError

        public void onError​(java.lang.Throwable t)
      • onComplete

        public void onComplete()
      • request

        public void request​(long n)
        Specified by:
        request in interface org.reactivestreams.Subscription
      • cancel

        public void cancel()
        Specified by:
        cancel in interface org.reactivestreams.Subscription
      • isCancelled

        public boolean isCancelled()
      • isFull

        boolean isFull()