Class AsyncSingleResultPublisher<T>

java.lang.Object
io.micronaut.core.async.publisher.AsyncSingleResultPublisher<T>
Type Parameters:
T - The argument type
All Implemented Interfaces:
Publishers.MicronautPublisher<T>, org.reactivestreams.Publisher<T>

public class AsyncSingleResultPublisher<T> extends Object implements Publishers.MicronautPublisher<T>
A Publisher that uses an ExecutorService to emit a single result.
Since:
1.0
  • Constructor Details

    • AsyncSingleResultPublisher

      public AsyncSingleResultPublisher(ExecutorService executor, Supplier<T> supplier)
      Constructor.
      Parameters:
      executor - executor
      supplier - type of supplier
    • AsyncSingleResultPublisher

      public AsyncSingleResultPublisher(Supplier<T> supplier)
      Constructor.
      Parameters:
      supplier - type of supplier
  • Method Details

    • subscribe

      public final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber)
      Specified by:
      subscribe in interface org.reactivestreams.Publisher<T>