Package org.apache.pekko.stream.scaladsl
Class Interleave<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.Interleave<T>
- All Implemented Interfaces:
Graph<UniformFanInShape<T,T>, NotUsed>
Interleave represents deterministic merge which takes N elements per input stream,
in-order of inputs, emits them downstream and then cycles/"wraps-around" the inputs.
'''Emits when''' element is available from current input (depending on phase)
'''Backpressures when''' downstream backpressures
'''Completes when''' all upstreams complete (eagerClose=false) or one upstream completes (eagerClose=true)
'''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> Graph<UniformFanInShape<T,T>, NotUsed> apply(int inputPorts, int segmentSize, boolean eagerClose) Create a newInterleavewith the specified number of input ports and given size of elements to take from each input.static <T> booleancreateLogic(Attributes inheritedAttributes) booleanin()intout()intshape()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
initialAttributes, 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
-
Interleave
public Interleave(int inputPorts, int segmentSize, boolean eagerClose)
-
-
Method Details
-
apply
public static <T> Graph<UniformFanInShape<T,T>, applyNotUsed> (int inputPorts, int segmentSize, boolean eagerClose) Create a newInterleavewith the specified number of input ports and given size of elements to take from each input.- Parameters:
inputPorts- number of input portssegmentSize- number of elements to send downstream before switching to next input porteagerClose- if true, interleave completes upstream if any of its upstream completes.
-
apply$default$3
public static <T> boolean apply$default$3() -
inputPorts
public int inputPorts() -
segmentSize
public int segmentSize() -
eagerClose
public boolean eagerClose() -
in
-
out
-
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
-