o

akka.stream.javadsl

BroadcastHub

object BroadcastHub

A BroadcastHub is a special streaming hub that is able to broadcast streamed elements to a dynamic set of consumers. It consists of two parts, a Sink and a Source. The Sink broadcasts elements from a producer to the actually live consumers it has. Once the producer has been materialized, the Sink it feeds into returns a materialized value which is the corresponding Source. This Source can be materialized an arbitrary number of times, where each of the new materializations will receive their elements from the original Sink.

Source
Hub.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BroadcastHub
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  14. def of[T](clazz: Class[T]): Sink[T, Source[T, NotUsed]]

    Creates a Sink with default buffer size 256 that receives elements from its upstream producer and broadcasts them to a dynamic set of consumers.

    Creates a Sink with default buffer size 256 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.

    clazz

    Type of elements this hub emits and consumes

  15. def of[T](clazz: Class[T], startAfterNrOfConsumers: Int, bufferSize: Int): Sink[T, Source[T, NotUsed]]

    Creates a Sink that receives elements from its upstream producer and broadcasts them to a dynamic set of consumers.

    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.

    clazz

    Type of elements this hub emits and consumes

    startAfterNrOfConsumers

    Elements are buffered until this number of consumers have been connected. This is only used initially when the operator is starting up, i.e. it is not honored when consumers have been removed (canceled).

    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.

  16. def of[T](clazz: Class[T], bufferSize: Int): Sink[T, Source[T, NotUsed]]

    Creates a Sink that receives elements from its upstream producer and broadcasts them to a dynamic set of consumers.

    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.

    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.

  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped