Class AsyncIterablePublisher<T>

  • All Implemented Interfaces:
    org.reactivestreams.Publisher<T>
    Direct Known Subclasses:
    InfiniteIncrementNumberPublisher, NumberIterablePublisher

    public class AsyncIterablePublisher<T>
    extends java.lang.Object
    implements org.reactivestreams.Publisher<T>
    AsyncIterablePublisher is an implementation of Reactive Streams `Publisher` which executes asynchronously, using a provided `Executor` and produces elements from a given `Iterable` in a "unicast" configuration to its `Subscribers`. NOTE: The code below uses a lot of try-catches to show the reader where exceptions can be expected, and where they are forbidden.
    • Constructor Summary

      Constructors 
      Constructor Description
      AsyncIterablePublisher​(java.lang.Iterable<T> elements, int batchSize, java.util.concurrent.Executor executor)  
      AsyncIterablePublisher​(java.lang.Iterable<T> elements, java.util.concurrent.Executor executor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void subscribe​(org.reactivestreams.Subscriber<? super T> s)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AsyncIterablePublisher

        public AsyncIterablePublisher​(java.lang.Iterable<T> elements,
                                      java.util.concurrent.Executor executor)
      • AsyncIterablePublisher

        public AsyncIterablePublisher​(java.lang.Iterable<T> elements,
                                      int batchSize,
                                      java.util.concurrent.Executor executor)
    • Method Detail

      • subscribe

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