Class ReactiveSupport

java.lang.Object
graphql.execution.reactive.ReactiveSupport

public class ReactiveSupport extends Object
This provides support for a DataFetcher to be able to return a reactive streams Publisher or Java JDK Flow.Publisher as a value, and it can be turned into a CompletableFuture that we can get an async value from.
  • Constructor Details

    • ReactiveSupport

      public ReactiveSupport()
  • Method Details

    • fetchedObject

      public static Object fetchedObject(Object fetchedObject)
    • whenPublisherFinishes

      public static <T> org.reactivestreams.Publisher<T> whenPublisherFinishes(org.reactivestreams.Publisher<T> publisher, Consumer<? super Throwable> atTheEndCallback)
      Our reactive SingleSubscriberPublisher supports only a single subscription so this can be used a delegate to perform a call back when the given Publisher actually finishes without adding an extra subscription to the delegate Publisher
      Type Parameters:
      T - for two
      Parameters:
      publisher - the publisher to wrap
      atTheEndCallback - the callback when the Publisher has finished