Class RangePublisher

  • All Implemented Interfaces:
    org.reactivestreams.Publisher<java.lang.Integer>

    public final class RangePublisher
    extends java.lang.Object
    implements org.reactivestreams.Publisher<java.lang.Integer>
    A synchronous implementation of the Publisher that can be subscribed to multiple times and each individual subscription will receive range of monotonically increasing integer values on demand.
    • Constructor Summary

      Constructors 
      Constructor Description
      RangePublisher​(int start, int count)
      Constructs a RangePublisher instance with the given start and count values that yields a sequence of [start, start + count).
    • Method Summary

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

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

      • RangePublisher

        public RangePublisher​(int start,
                              int count)
        Constructs a RangePublisher instance with the given start and count values that yields a sequence of [start, start + count).
        Parameters:
        start - the starting value of the range
        count - the number of items to emit
    • Method Detail

      • subscribe

        public void subscribe​(org.reactivestreams.Subscriber<? super java.lang.Integer> subscriber)
        Specified by:
        subscribe in interface org.reactivestreams.Publisher<java.lang.Integer>