Class BroadcastHub$

  • public class BroadcastHub$
    extends java.lang.Object
    Creates a Sink that receives elements from its upstream producer and broadcasts them to a dynamic set of consumers. After the Sink returned by this method is materialized, it returns a Source as materialized value. This Source can be materialized an arbitrary number of times and each materialization will receive the broadcast elements from the original Sink.

    Every new materialization of the Sink results in a new, independent hub, which materializes to its own Source for consuming the Sink of that materialization.

    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 all corresponding 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.

    param: clazz Type of elements this hub emits and consumes param: 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.

    • Field Summary

      Modifier and Type Field Description
      static BroadcastHub$ MODULE$
      Static reference to the singleton instance of this Scala object.
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> Sink<T,​Source<T,​NotUsed>> of​(java.lang.Class<T> clazz)  
      <T> Sink<T,​Source<T,​NotUsed>> of​(java.lang.Class<T> clazz, int bufferSize)  
      • Methods inherited from class java.lang.Object

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

      • MODULE$

        public static final BroadcastHub$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • BroadcastHub$

        public BroadcastHub$()
    • Method Detail

      • of

        public <T> Sink<T,​Source<T,​NotUsed>> of​(java.lang.Class<T> clazz,
                                                            int bufferSize)