Package akka.stream.scaladsl
Class MergePrioritized<T>
- java.lang.Object
-
- akka.stream.stage.GraphStageWithMaterializedValue<S,NotUsed>
-
- akka.stream.stage.GraphStage<UniformFanInShape<T,T>>
-
- akka.stream.scaladsl.MergePrioritized<T>
-
- All Implemented Interfaces:
Graph<UniformFanInShape<T,T>,NotUsed>
public final class MergePrioritized<T> extends GraphStage<UniformFanInShape<T,T>>
Merge several streams, taking elements as they arrive from input streams (picking from prioritized once when several have elements ready).A
MergePrioritizedhas oneoutport, one or more input port with their priorities.'''Emits when''' one of the inputs has an element available, preferring a input based on its priority 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 classes/interfaces inherited from interface akka.stream.Graph
Graph.GraphMapMatVal<S extends Shape,M>
-
-
Constructor Summary
Constructors Constructor Description MergePrioritized()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> GraphStage<UniformFanInShape<T,T>>apply(scala.collection.immutable.Seq<java.lang.Object> priorities, boolean eagerComplete)Create a newMergePrioritizedwith specified number of input ports.static <T> booleanapply$default$2()GraphStageLogiccreateLogic(Attributes inheritedAttributes)booleaneagerComplete()scala.collection.immutable.IndexedSeq<Inlet<T>>in()AttributesinitialAttributes()Outlet<T>out()scala.collection.immutable.Seq<java.lang.Object>priorities()UniformFanInShape<T,T>shape()The shape of a graph is all that is externally visible: its inlets and outlets.java.lang.StringtoString()-
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> GraphStage<UniformFanInShape<T,T>> apply(scala.collection.immutable.Seq<java.lang.Object> priorities, boolean eagerComplete)
Create a newMergePrioritizedwith specified number of input ports.- Parameters:
priorities- priorities of the 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()
-
priorities
public scala.collection.immutable.Seq<java.lang.Object> priorities()
-
eagerComplete
public boolean eagerComplete()
-
initialAttributes
public Attributes initialAttributes()
- Overrides:
initialAttributesin classGraphStageWithMaterializedValue<UniformFanInShape<T,T>,NotUsed>
-
shape
public UniformFanInShape<T,T> shape()
Description copied from interface:GraphThe shape of a graph is all that is externally visible: its inlets and outlets.
-
createLogic
public GraphStageLogic createLogic(Attributes inheritedAttributes)
- Specified by:
createLogicin classGraphStage<UniformFanInShape<T,T>>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-