Package org.apache.pekko.stream.javadsl
Class BidiFlow$
java.lang.Object
org.apache.pekko.stream.javadsl.BidiFlow$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbidirectionalIdleTimeout
(Duration timeout) If the time between two processed elements *in any direction* exceed the provided timeout, the stream is failed with aBackpressureTimeoutException
.Wraps two Flows to create a ''BidiFlow''.<I1,
O1, I2, O2, M1, M2, M>
BidiFlow<I1,O1, I2, O2, M> fromFlowsMat
(Graph<FlowShape<I1, O1>, M1> flow1, Graph<FlowShape<I2, O2>, M2> flow2, Function2<M1, M2, M> combine) Wraps two Flows to create a ''BidiFlow''.fromFunctions
(Function<I1, O1> top, Function<I2, O2> bottom) Create a BidiFlow where the top and bottom flows are just one simple mapping operator each, expressed by the two functions.<I1,
O1, I2, O2, M>
BidiFlow<I1,O1, I2, O2, M> A graph with the shape of a BidiFlow logically is a BidiFlow, this method makes it so also in type.identity()
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
BidiFlow$
public BidiFlow$()
-
-
Method Details
-
identity
-
fromGraph
A graph with the shape of a BidiFlow logically is a BidiFlow, this method makes it so also in type. -
fromFlowsMat
public <I1,O1, BidiFlow<I1,I2, O2, M1, M2, M> O1, fromFlowsMatI2, O2, M> (Graph<FlowShape<I1, O1>, M1> flow1, Graph<FlowShape<I2, O2>, M2> flow2, Function2<M1, M2, M> combine) Wraps two Flows to create a ''BidiFlow''. The materialized value of the resulting BidiFlow is determined by the combiner function passed in the second argument list.+----------------------------+ | Resulting BidiFlow | | | | +----------------------+ | I1 ~~> | Flow1 | ~~> O1 | +----------------------+ | | | | +----------------------+ | O2 <~~ | Flow2 | <~~ I2 | +----------------------+ | +----------------------------+
-
fromFlows
public <I1,O1, BidiFlow<I1,I2, O2, M1, M2> O1, fromFlowsI2, O2, NotUsed> (Graph<FlowShape<I1, O1>, M1> flow1, Graph<FlowShape<I2, O2>, M2> flow2) Wraps two Flows to create a ''BidiFlow''. The materialized value of the resulting BidiFlow is NotUsed.+----------------------------+ | Resulting BidiFlow | | | | +----------------------+ | I1 ~~> | Flow1 | ~~> O1 | +----------------------+ | | | | +----------------------+ | O2 <~~ | Flow2 | <~~ I2 | +----------------------+ | +----------------------------+
-
fromFunctions
public <I1,O1, BidiFlow<I1,I2, O2> O1, fromFunctionsI2, O2, NotUsed> (Function<I1, O1> top, Function<I2, O2> bottom) Create a BidiFlow where the top and bottom flows are just one simple mapping operator each, expressed by the two functions. -
bidirectionalIdleTimeout
If the time between two processed elements *in any direction* exceed the provided timeout, the stream is failed with aBackpressureTimeoutException
.There is a difference between this operator and having two idleTimeout Flows assembled into a BidiStage. If the timeout is configured to be 1 seconds, then this operator will not fail even though there are elements flowing every second in one direction, but no elements are flowing in the other direction. I.e. this operator considers the *joint* frequencies of the elements in both directions.
-