Package akka.stream.scaladsl
Class Interleave<T>
- java.lang.Object
-
- akka.stream.stage.GraphStageWithMaterializedValue<S,NotUsed>
-
- akka.stream.stage.GraphStage<UniformFanInShape<T,T>>
-
- akka.stream.scaladsl.Interleave<T>
-
- All Implemented Interfaces:
Graph<UniformFanInShape<T,T>,NotUsed>
public final class Interleave<T> extends GraphStage<UniformFanInShape<T,T>>
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 akka.stream.Graph
Graph.GraphMapMatVal<S extends Shape,M>
-
-
Constructor Summary
Constructors Constructor Description Interleave(int inputPorts, int segmentSize, boolean eagerClose)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Graph<UniformFanInShape<T,T>,NotUsed>
apply(int inputPorts, int segmentSize, boolean eagerClose)
Create a newInterleave
with the specified number of input ports and given size of elements to take from each input.static <T> boolean
apply$default$3()
GraphStageLogic
createLogic(Attributes inheritedAttributes)
boolean
eagerClose()
scala.collection.immutable.IndexedSeq<Inlet<T>>
in()
int
inputPorts()
Outlet<T>
out()
int
segmentSize()
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
initialAttributes, 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> Graph<UniformFanInShape<T,T>,NotUsed> apply(int inputPorts, int segmentSize, boolean eagerClose)
Create a newInterleave
with 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()
-
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
-
-