Class CompletionStageMappingPublisher.CompletionStageSubscriber

java.lang.Object
graphql.execution.reactive.CompletionStageMappingPublisher.CompletionStageSubscriber
All Implemented Interfaces:
org.reactivestreams.Subscriber<U>
Enclosing class:
CompletionStageMappingPublisher<D,U>

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

    • downstreamSubscriber

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

      org.reactivestreams.Subscription delegatingSubscription
    • inFlightDataQ

      final Queue<CompletionStage<?>> inFlightDataQ
    • lock

    • onCompleteOrErrorRun

      final AtomicReference<Runnable> onCompleteOrErrorRun
    • onCompleteOrErrorRunCalled

      final AtomicBoolean onCompleteOrErrorRunCalled
  • Constructor Details

    • CompletionStageSubscriber

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

    • 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 BiConsumer<D,Throwable> whenNextFinished(CompletionStage<D> completionStage)
    • handleThrowable

      private void handleThrowable(Throwable throwable)
    • onError

      public void onError(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(Runnable doneCodeToRun)
    • offerToInFlightQ

      private void offerToInFlightQ(CompletionStage<?> completionStage)
    • removeFromInFlightQAndCheckIfEmpty

      private boolean removeFromInFlightQAndCheckIfEmpty(CompletionStage<?> completionStage)
    • inFlightQIsEmpty

      private boolean inFlightQIsEmpty()