Package akka.stream.scaladsl
Class Merge<T>
- java.lang.Object
-
- akka.stream.stage.GraphStageWithMaterializedValue<S,NotUsed>
-
- akka.stream.stage.GraphStage<UniformFanInShape<T,T>>
-
- akka.stream.scaladsl.Merge<T>
-
- All Implemented Interfaces:
Graph<UniformFanInShape<T,T>,NotUsed>
public final class Merge<T> extends GraphStage<UniformFanInShape<T,T>>
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 akka.stream.Graph
Graph.GraphMapMatVal<S extends Shape,M>
-
-
Constructor Summary
Constructors Constructor Description Merge(int inputPorts, boolean eagerComplete)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Merge<T>
apply(int inputPorts, boolean eagerComplete)
Create a newMerge
with the specified number of input ports.static <T> boolean
apply$default$2()
GraphStageLogic
createLogic(Attributes inheritedAttributes)
boolean
eagerComplete()
scala.collection.immutable.IndexedSeq<Inlet<T>>
in()
Attributes
initialAttributes()
int
inputPorts()
Outlet<T>
out()
UniformFanInShape<T,T>
shape()
The shape of a graph is all that is externally visible: its inlets and outlets.java.lang.String
toString()
-
Methods inherited from class akka.stream.stage.GraphStage
createLogicAndMaterializedValue
-
Methods inherited from class akka.stream.stage.GraphStageWithMaterializedValue
withAttributes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.stream.Graph
addAttributes, async, async, async, getAttributes, named
-
-
-
-
Method Detail
-
apply
public static <T> Merge<T> apply(int inputPorts, boolean eagerComplete)
Create a newMerge
with 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()
-
initialAttributes
public Attributes initialAttributes()
- Overrides:
initialAttributes
in classGraphStageWithMaterializedValue<UniformFanInShape<T,T>,NotUsed>
-
shape
public UniformFanInShape<T,T> shape()
Description copied from interface:Graph
The shape of a graph is all that is externally visible: its inlets and outlets.
-
createLogic
public GraphStageLogic createLogic(Attributes inheritedAttributes)
- Specified by:
createLogic
in classGraphStage<UniformFanInShape<T,T>>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-