Package org.apache.pekko.stream.scaladsl
Class MergePreferred<T>
java.lang.Object
org.apache.pekko.stream.stage.GraphStageWithMaterializedValue<S,NotUsed>
org.apache.pekko.stream.stage.GraphStage<MergePreferred.MergePreferredShape<T>>
org.apache.pekko.stream.scaladsl.MergePreferred<T>
- All Implemented Interfaces:
Graph<MergePreferred.MergePreferredShape<T>,NotUsed>
Merge several streams, taking elements as they arrive from input streams
(picking from preferred when several have elements ready).
A MergePreferred has one out port, one preferred input port and 1 or more secondary in ports.
'''Emits when''' one of the inputs has an element available, preferring a specified input if multiple have elements 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 ClassesNested 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> MergePreferred<T>apply(int secondaryPorts, boolean eagerComplete) Create a newMergePreferredwith the specified number of secondary input ports.static <T> booleancreateLogic(Attributes inheritedAttributes) booleanin(int id) out()intshape()The shape of a graph is all that is externally visible: its inlets and outlets.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, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.stream.Graph
addAttributes, async, async, async, getAttributes, named
-
Constructor Details
-
MergePreferred
public MergePreferred(int secondaryPorts, boolean eagerComplete)
-
-
Method Details
-
apply
Create a newMergePreferredwith the specified number of secondary input ports.- Parameters:
secondaryPorts- number of secondary 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() -
secondaryPorts
public int secondaryPorts() -
eagerComplete
public boolean eagerComplete() -
initialAttributes
- Overrides:
initialAttributesin classGraphStageWithMaterializedValue<MergePreferred.MergePreferredShape<T>,NotUsed>
-
shape
Description copied from interface:GraphThe shape of a graph is all that is externally visible: its inlets and outlets. -
in
-
out
-
preferred
-
createLogic
- Specified by:
createLogicin classGraphStage<MergePreferred.MergePreferredShape<T>>
-