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.Subscription
delegatingSubscription
private org.reactivestreams.Subscriber<? super D>
downstreamSubscriber
(package private) java.util.Queue<java.util.concurrent.CompletionStage<?>>
inFlightDataQ
(package private) LockKit.ReentrantLock
lock
(package private) java.util.concurrent.atomic.AtomicReference<java.lang.Runnable>
onCompleteOrErrorRun
(package private) java.util.concurrent.atomic.AtomicBoolean
onCompleteOrErrorRunCalled
-
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 void
handleThrowable(java.lang.Throwable throwable)
private boolean
inFlightQIsEmpty()
private void
offerToInFlightQ(java.util.concurrent.CompletionStage<?> completionStage)
void
onComplete()
private void
onCompleteOrError(java.lang.Runnable doneCodeToRun)
void
onError(java.lang.Throwable t)
void
onNext(U u)
void
onSubscribe(org.reactivestreams.Subscription subscription)
private boolean
removeFromInFlightQAndCheckIfEmpty(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:
onSubscribe
in 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:
onError
in interfaceorg.reactivestreams.Subscriber<U>
-
onComplete
public void onComplete()
- Specified by:
onComplete
in 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()
-
-