Package graphql.execution.reactive
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 java.lang.Object implements org.reactivestreams.Subscriber<U>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.reactivestreams.SubscriptiondelegatingSubscriptionprivate org.reactivestreams.Subscriber<? super D>downstreamSubscriber(package private) java.util.Queue<java.util.concurrent.CompletionStage<?>>inFlightDataQ(package private) LockKit.ReentrantLocklock(package private) java.util.concurrent.atomic.AtomicReference<java.lang.Runnable>onCompleteOrErrorRun(package private) java.util.concurrent.atomic.AtomicBooleanonCompleteOrErrorRunCalled
-
Constructor Summary
Constructors Constructor Description CompletionStageSubscriber(org.reactivestreams.Subscriber<? super D> downstreamSubscriber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.reactivestreams.Subscriber<? super D>getDownstreamSubscriber()Get instance of downstream subscriberprivate voidhandleThrowable(java.lang.Throwable throwable)private booleaninFlightQIsEmpty()private voidofferToInFlightQ(java.util.concurrent.CompletionStage<?> completionStage)voidonComplete()private voidonCompleteOrError(java.lang.Runnable doneCodeToRun)voidonError(java.lang.Throwable t)voidonNext(U u)voidonSubscribe(org.reactivestreams.Subscription subscription)private booleanremoveFromInFlightQAndCheckIfEmpty(java.util.concurrent.CompletionStage<?> completionStage)private java.util.function.BiConsumer<D,java.lang.Throwable>whenNextFinished(java.util.concurrent.CompletionStage<D> completionStage)
-
-
-
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
-
lock
final LockKit.ReentrantLock lock
-
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:
onSubscribein interfaceorg.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:
onErrorin interfaceorg.reactivestreams.Subscriber<U>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceorg.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()
-
-