Class CompletionStageMappingPublisher<D,U>

java.lang.Object
graphql.execution.reactive.CompletionStageMappingPublisher<D,U>
Type Parameters:
D - the downstream type
U - the upstream type to be mapped to
All Implemented Interfaces:
org.reactivestreams.Publisher<D>
Direct Known Subclasses:
CompletionStageMappingOrderedPublisher

public class CompletionStageMappingPublisher<D,U> extends Object implements org.reactivestreams.Publisher<D>
A reactive Publisher that bridges over another Publisher of `D` and maps the results to type `U` via a CompletionStage, handling errors in that stage
  • Field Details

    • upstreamPublisher

      protected final org.reactivestreams.Publisher<U> upstreamPublisher
    • mapper

      protected final Function<U,CompletionStage<D>> mapper
  • Constructor Details

    • CompletionStageMappingPublisher

      public CompletionStageMappingPublisher(org.reactivestreams.Publisher<U> upstreamPublisher, Function<U,CompletionStage<D>> mapper)
      You need the following :
      Parameters:
      upstreamPublisher - an upstream source of data
      mapper - a mapper function that turns upstream data into a promise of mapped D downstream data
  • Method Details

    • subscribe

      public void subscribe(org.reactivestreams.Subscriber<? super D> downstreamSubscriber)
      Specified by:
      subscribe in interface org.reactivestreams.Publisher<D>
    • createSubscriber

      protected @NonNull org.reactivestreams.Subscriber<? super U> createSubscriber(org.reactivestreams.Subscriber<? super D> downstreamSubscriber)
    • getUpstreamPublisher

      public org.reactivestreams.Publisher<U> getUpstreamPublisher()
      Get instance of an upstreamPublisher
      Returns:
      upstream instance of Publisher