Class SinglePostCompleteSubscriber<T,​R>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static long COMPLETE_MASK
      Masks out the 2^63 bit indicating a completed state.
      protected org.reactivestreams.Subscriber<? super R> downstream
      The downstream consumer.
      protected long produced
      Number of values emitted so far.
      (package private) static long REQUEST_MASK
      Masks out the lower 63 bit holding the current request amount.
      private static long serialVersionUID  
      protected org.reactivestreams.Subscription upstream
      The upstream subscription.
      protected R value
      The last value stored in case there is no request for it.
    • Constructor Summary

      Constructors 
      Constructor Description
      SinglePostCompleteSubscriber​(org.reactivestreams.Subscriber<? super R> downstream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()  
      protected void complete​(R n)
      Signals the given value and an onComplete if the downstream is ready to receive the final value.
      protected void onDrop​(R n)
      Called in case of multiple calls to complete.
      void onSubscribe​(org.reactivestreams.Subscription s)
      Implementors of this method should make sure everything that needs to be visible in Subscriber.onNext(Object) is established before calling Subscription.request(long).
      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
      • Methods inherited from interface org.reactivestreams.Subscriber

        onComplete, onError, onNext
    • Field Detail

      • downstream

        protected final org.reactivestreams.Subscriber<? super R> downstream
        The downstream consumer.
      • upstream

        protected org.reactivestreams.Subscription upstream
        The upstream subscription.
      • value

        protected R value
        The last value stored in case there is no request for it.
      • produced

        protected long produced
        Number of values emitted so far.
      • COMPLETE_MASK

        static final long COMPLETE_MASK
        Masks out the 2^63 bit indicating a completed state.
        See Also:
        Constant Field Values
      • REQUEST_MASK

        static final long REQUEST_MASK
        Masks out the lower 63 bit holding the current request amount.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SinglePostCompleteSubscriber

        public SinglePostCompleteSubscriber​(org.reactivestreams.Subscriber<? super R> downstream)
    • Method Detail

      • onSubscribe

        public void onSubscribe​(org.reactivestreams.Subscription s)
        Description copied from interface: FlowableSubscriber
        Implementors of this method should make sure everything that needs to be visible in Subscriber.onNext(Object) is established before calling Subscription.request(long). In practice this means no initialization should happen after the request() call and additional behavior is thread safe in respect to onNext.
        Specified by:
        onSubscribe in interface FlowableSubscriber<T>
        Specified by:
        onSubscribe in interface org.reactivestreams.Subscriber<T>
      • complete

        protected final void complete​(R n)
        Signals the given value and an onComplete if the downstream is ready to receive the final value.
        Parameters:
        n - the value to emit
      • onDrop

        protected void onDrop​(R n)
        Called in case of multiple calls to complete.
        Parameters:
        n - the value dropped
      • request

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

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