Package akka.stream.scaladsl
Class MergeHub<T>
- java.lang.Object
-
- akka.stream.stage.GraphStageWithMaterializedValue<SourceShape<T>,Sink<T,NotUsed>>
-
- akka.stream.scaladsl.MergeHub<T>
-
- All Implemented Interfaces:
Graph<SourceShape<T>,Sink<T,NotUsed>>
public class MergeHub<T> extends GraphStageWithMaterializedValue<SourceShape<T>,Sink<T,NotUsed>>
INTERNAL API
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMergeHub.EventclassMergeHub.InputStateclassMergeHub.MergedSourceLogicstatic classMergeHub.ProducerFailed
-
Constructor Summary
Constructors Constructor Description MergeHub(int perProducerBufferSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.Tuple2<GraphStageLogic,Sink<T,NotUsed>>createLogicAndMaterializedValue(Attributes inheritedAttributes)Outlet<T>out()SourceShape<T>shape()The shape of a graph is all that is externally visible: its inlets and outlets.static <T> Source<T,Sink<T,NotUsed>>source()Creates aSourcethat emits elements merged from a dynamic set of producers.static <T> Source<T,Sink<T,NotUsed>>source(int perProducerBufferSize)Creates aSourcethat emits elements merged from a dynamic set of producers.-
Methods inherited from class akka.stream.stage.GraphStageWithMaterializedValue
createLogicAndMaterializedValue, initialAttributes, traversalBuilder, withAttributes
-
-
-
-
Method Detail
-
source
public static <T> Source<T,Sink<T,NotUsed>> source(int perProducerBufferSize)
Creates aSourcethat emits elements merged from a dynamic set of producers. After theSourcereturned by this method is materialized, it returns aSinkas a materialized value. ThisSinkcan be materialized arbitrary many times and each of the materializations will feed the elements into the originalSource.Every new materialization of the
Sourceresults in a new, independent hub, which materializes to its ownSinkfor feeding that materialization.Completed or failed
Sinks are simply removed. Once theSourceis cancelled, the Hub is considered closed and any new producers using theSinkwill be cancelled.- Parameters:
perProducerBufferSize- Buffer space used per producer. Default value is 16.- Returns:
- (undocumented)
-
source
public static <T> Source<T,Sink<T,NotUsed>> source()
Creates aSourcethat emits elements merged from a dynamic set of producers. After theSourcereturned by this method is materialized, it returns aSinkas a materialized value. ThisSinkcan be materialized arbitrary many times and each of the materializations will feed the elements into the originalSource.Every new materialization of the
Sourceresults in a new, independent hub, which materializes to its ownSinkfor feeding that materialization.Completed or failed
Sinks are simply removed. Once theSourceis cancelled, the Hub is considered closed and any new producers using theSinkwill be cancelled.- Returns:
- (undocumented)
-
shape
public SourceShape<T> shape()
Description copied from interface:GraphThe shape of a graph is all that is externally visible: its inlets and outlets.- Returns:
- (undocumented)
-
createLogicAndMaterializedValue
public scala.Tuple2<GraphStageLogic,Sink<T,NotUsed>> createLogicAndMaterializedValue(Attributes inheritedAttributes)
- Specified by:
createLogicAndMaterializedValuein classGraphStageWithMaterializedValue<SourceShape<T>,Sink<T,NotUsed>>
-
-