Package akka.stream.scaladsl
Class BidiFlow$
- java.lang.Object
-
- akka.stream.scaladsl.BidiFlow$
-
public class BidiFlow$ extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description BidiFlow$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <I,O>
BidiFlow<I,I,O,O,NotUsed>bidirectionalIdleTimeout(scala.concurrent.duration.FiniteDuration timeout)
If the time between two processed elements *in any direction* exceed the provided timeout, the stream is failed with ascala.concurrent.TimeoutException
.<I1,O1,I2,O2,M1,M2>
BidiFlow<I1,O1,I2,O2,NotUsed>fromFlows(Graph<FlowShape<I1,O1>,M1> flow1, Graph<FlowShape<I2,O2>,M2> flow2)
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, scala.Function2<M1,M2,M> combine)
Wraps two Flows to create a ''BidiFlow''.<I1,O1,I2,O2>
BidiFlow<I1,O1,I2,O2,NotUsed>fromFunctions(scala.Function1<I1,O1> outbound, scala.Function1<I2,O2> inbound)
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,Mat>
BidiFlow<I1,O1,I2,O2,Mat>fromGraph(Graph<BidiShape<I1,O1,I2,O2>,Mat> graph)
A graph with the shape of a flow logically is a flow, this method makes it so also in type.<A,B>
BidiFlow<A,A,B,B,NotUsed>identity()
-
-
-
Field Detail
-
MODULE$
public static final BidiFlow$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
fromGraph
public <I1,O1,I2,O2,Mat> BidiFlow<I1,O1,I2,O2,Mat> fromGraph(Graph<BidiShape<I1,O1,I2,O2>,Mat> graph)
A graph with the shape of a flow logically is a flow, this method makes it so also in type.
-
fromFlowsMat
public <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, scala.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,I2,O2,M1,M2> BidiFlow<I1,O1,I2,O2,NotUsed> fromFlows(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 Unit.+----------------------------+ | Resulting BidiFlow | | | | +----------------------+ | I1 ~~> | Flow1 | ~~> O1 | +----------------------+ | | | | +----------------------+ | O2 <~~ | Flow2 | <~~ I2 | +----------------------+ | +----------------------------+
-
fromFunctions
public <I1,O1,I2,O2> BidiFlow<I1,O1,I2,O2,NotUsed> fromFunctions(scala.Function1<I1,O1> outbound, scala.Function1<I2,O2> inbound)
Create a BidiFlow where the top and bottom flows are just one simple mapping operator each, expressed by the two functions.
-
bidirectionalIdleTimeout
public <I,O> BidiFlow<I,I,O,O,NotUsed> bidirectionalIdleTimeout(scala.concurrent.duration.FiniteDuration timeout)
If the time between two processed elements *in any direction* exceed the provided timeout, the stream is failed with ascala.concurrent.TimeoutException
.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.
-
-