Package graphql.execution.reactive
Class SubscriptionPublisher
- java.lang.Object
-
- graphql.execution.reactive.SubscriptionPublisher
-
- All Implemented Interfaces:
org.reactivestreams.Publisher<ExecutionResult>
@PublicApi public class SubscriptionPublisher extends java.lang.Object implements org.reactivestreams.Publisher<ExecutionResult>
Subscription queries return an instance of this class in theExecutionResult
data element for the subscribed field.ExecutionResult er = graphQL.execute("subscription s { onEntityChanged(id : "1") { selection1, selection2 }}") SubscriptionPublisher eventPublisher = er.getData("onEntityChanged")
-
-
Constructor Summary
Constructors Constructor Description SubscriptionPublisher(org.reactivestreams.Publisher<java.lang.Object> upstreamPublisher, java.util.function.Function<java.lang.Object,java.util.concurrent.CompletionStage<ExecutionResult>> mapper, boolean keepOrdered)
Subscription consuming code is not expected to create instances of this class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.reactivestreams.Publisher<java.lang.Object>
getUpstreamPublisher()
void
subscribe(org.reactivestreams.Subscriber<? super ExecutionResult> subscriber)
-
-
-
Constructor Detail
-
SubscriptionPublisher
public SubscriptionPublisher(org.reactivestreams.Publisher<java.lang.Object> upstreamPublisher, java.util.function.Function<java.lang.Object,java.util.concurrent.CompletionStage<ExecutionResult>> mapper, boolean keepOrdered)
Subscription consuming code is not expected to create instances of this class- Parameters:
upstreamPublisher
- the original publisher of objects that then have a graphql selection set applied to themmapper
- a mapper that turns object into promises to execution results which are then published on this streamkeepOrdered
- this indicates that the order of results should be kep in the same order as the source events arrive
-
-
Method Detail
-
getUpstreamPublisher
public org.reactivestreams.Publisher<java.lang.Object> getUpstreamPublisher()
- Returns:
- the underlying Publisher that was providing raw objects to the subscription field, whose published values are then mapped to execution results
-
subscribe
public void subscribe(org.reactivestreams.Subscriber<? super ExecutionResult> subscriber)
- Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<ExecutionResult>
-
-