Class CompletionStageMappingPublisher.CompletionStageSubscriber

  • All Implemented Interfaces:
    org.reactivestreams.Subscriber<U>
    Enclosing class:
    CompletionStageMappingPublisher<D,​U>

    public class CompletionStageMappingPublisher.CompletionStageSubscriber
    extends java.lang.Object
    implements org.reactivestreams.Subscriber<U>
    • Field Detail

      • downstreamSubscriber

        private final org.reactivestreams.Subscriber<? super D> downstreamSubscriber
      • delegatingSubscription

        org.reactivestreams.Subscription delegatingSubscription
      • inFlightDataQ

        final java.util.Queue<java.util.concurrent.CompletionStage<?>> inFlightDataQ
      • onCompleteOrErrorRun

        final java.util.concurrent.atomic.AtomicReference<java.lang.Runnable> onCompleteOrErrorRun
      • onCompleteOrErrorRunCalled

        final java.util.concurrent.atomic.AtomicBoolean onCompleteOrErrorRunCalled
    • Constructor Detail

      • CompletionStageSubscriber

        public CompletionStageSubscriber​(org.reactivestreams.Subscriber<? super D> downstreamSubscriber)
    • Method Detail

      • onSubscribe

        public void onSubscribe​(org.reactivestreams.Subscription subscription)
        Specified by:
        onSubscribe in interface org.reactivestreams.Subscriber<U>
      • onNext

        public void onNext​(U u)
        Specified by:
        onNext in interface org.reactivestreams.Subscriber<U>
      • whenNextFinished

        private java.util.function.BiConsumer<D,​java.lang.Throwable> whenNextFinished​(java.util.concurrent.CompletionStage<D> completionStage)
      • handleThrowable

        private void handleThrowable​(java.lang.Throwable throwable)
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface org.reactivestreams.Subscriber<U>
      • onComplete

        public void onComplete()
        Specified by:
        onComplete in interface org.reactivestreams.Subscriber<U>
      • getDownstreamSubscriber

        public org.reactivestreams.Subscriber<? super D> getDownstreamSubscriber()
        Get instance of downstream subscriber
        Returns:
        Subscriber
      • onCompleteOrError

        private void onCompleteOrError​(java.lang.Runnable doneCodeToRun)
      • offerToInFlightQ

        private void offerToInFlightQ​(java.util.concurrent.CompletionStage<?> completionStage)
      • removeFromInFlightQAndCheckIfEmpty

        private boolean removeFromInFlightQAndCheckIfEmpty​(java.util.concurrent.CompletionStage<?> completionStage)
      • inFlightQIsEmpty

        private boolean inFlightQIsEmpty()