public class BroadcastHub extends java.lang.Object
Sinkbroadcasts elements from a producer to the actually live consumers it has. Once the producer has been materialized, the
Sinkit feeds into returns a materialized value which is the corresponding
Sourcecan be materialized an arbitrary number of times, where each of the new materializations will receive their elements from the original
|Constructor and Description|
|Modifier and Type||Method and Description|
Sinkthat receives elements from its upstream producer and broadcasts them to a dynamic set of consumers. After the
Sinkreturned by this method is materialized, it returns a
Sourceas materialized value. This
Sourcecan be materialized an arbitrary number of times and each materialization will receive the broadcast elements from the original
If the original
Sink is failed, then the failure is immediately propagated to all of its materialized
Sources (possibly jumping over already buffered elements). If the original
Sink is completed, then
Sources are completed. Both failure and normal completion is "remembered" and later
materializations of the
Source will see the same (failure or completion) state.
Sources that are
cancelled are simply removed from the dynamic set of consumers.
clazz- Type of elements this hub emits and consumes
bufferSize- Buffer size used by the producer. Gives an upper bound on how "far" from each other two concurrent consumers can be in terms of element. If the buffer is full, the producer is backpressured. Must be a power of two and less than 4096.