Class RangePublisher
- java.lang.Object
-
- org.reactivestreams.example.unicast.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 thePublisher
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)
-
-
-
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 rangecount
- the number of items to emit
-
-
Method Detail
-
subscribe
public void subscribe(org.reactivestreams.Subscriber<? super java.lang.Integer> subscriber)
- Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<java.lang.Integer>
-
-