Package org.apache.pekko.stream.scaladsl
Class Merge<T>
java.lang.Object
org.apache.pekko.stream.stage.GraphStageWithMaterializedValue<S,NotUsed>
org.apache.pekko.stream.stage.GraphStage<UniformFanInShape<T,T>>
org.apache.pekko.stream.scaladsl.Merge<T>
- All Implemented Interfaces:
Graph<UniformFanInShape<T,T>, NotUsed>
Merge several streams, taking elements as they arrive from input streams
(picking randomly when several have elements ready).
'''Emits when''' one of the inputs has an element available
'''Backpressures when''' downstream backpressures
'''Completes when''' all upstreams complete (eagerComplete=false) or one upstream completes (eagerComplete=true), default value is false
'''Cancels when''' downstream cancels
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.pekko.stream.Graph
Graph.GraphMapMatVal<S extends Shape,M> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Merge<T>apply(int inputPorts, boolean eagerComplete) Create a newMergewith the specified number of input ports.static <T> booleancreateLogic(Attributes inheritedAttributes) booleanin()intout()shape()The shape of a graph is all that is externally visible: its inlets and outlets.toString()Methods inherited from class org.apache.pekko.stream.stage.GraphStage
createLogicAndMaterializedValueMethods inherited from class org.apache.pekko.stream.stage.GraphStageWithMaterializedValue
withAttributesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.pekko.stream.Graph
addAttributes, async, async, async, getAttributes, named
-
Constructor Details
-
Merge
public Merge(int inputPorts, boolean eagerComplete)
-
-
Method Details
-
apply
Create a newMergewith the specified number of input ports.- Parameters:
inputPorts- number of input portseagerComplete- if true, the merge will complete as soon as one of its inputs completes.
-
apply$default$2
public static <T> boolean apply$default$2() -
inputPorts
public int inputPorts() -
eagerComplete
public boolean eagerComplete() -
in
-
out
-
initialAttributes
- Overrides:
initialAttributesin classGraphStageWithMaterializedValue<UniformFanInShape<T,T>, NotUsed>
-
shape
Description copied from interface:GraphThe shape of a graph is all that is externally visible: its inlets and outlets. -
createLogic
- Specified by:
createLogicin classGraphStage<UniformFanInShape<T,T>>
-
toString
-