Class BidiFlow<I1,O1,I2,O2,Mat>
- java.lang.Object
- 
- org.apache.pekko.stream.javadsl.BidiFlow<I1,O1,I2,O2,Mat>
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.pekko.stream.GraphGraph.GraphMapMatVal<S extends Shape,M>
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BidiFlow<I1,O1,I2,O2,Mat>addAttributes(Attributes attr)Add the given attributes to this Source.BidiFlow<I1,O1,I2,O2,Mat>asScala()BidiFlow<I1,O1,I2,O2,Mat>async()Put an asynchronous boundary around thisFlowBidiFlow<I1,O1,I2,O2,Mat>async(java.lang.String dispatcher)Put an asynchronous boundary around thisFlowBidiFlow<I1,O1,I2,O2,Mat>async(java.lang.String dispatcher, int inputBufferSize)Put an asynchronous boundary around thisFlow<OO1,II2,Mat2>
 BidiFlow<I1,OO1,II2,O2,Mat>atop(BidiFlow<O1,OO1,II2,I2,Mat2> bidi)Add the given BidiFlow as the next step in a bidirectional transformation pipeline.<OO1,II2,Mat2,M>
 BidiFlow<I1,OO1,II2,O2,M>atop(BidiFlow<O1,OO1,II2,I2,Mat2> bidi, Function2<Mat,Mat2,M> combine)Add the given BidiFlow as the next step in a bidirectional transformation 161static <I,O>
 BidiFlow<I,I,O,O,NotUsed>bidirectionalIdleTimeout(java.time.Duration timeout)If the time between two processed elements *in any direction* exceed the provided timeout, the stream is failed with aBackpressureTimeoutException.static <I,O>
 BidiFlow<I,I,O,O,NotUsed>bidirectionalIdleTimeout(scala.concurrent.duration.FiniteDuration timeout)Deprecated.Use the overloaded one which accepts java.time.Duration instead.static <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''.static <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''.static <I1,O1,I2,O2>
 BidiFlow<I1,O1,I2,O2,NotUsed>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.static <I1,O1,I2,O2,M>
 BidiFlow<I1,O1,I2,O2,M>fromGraph(Graph<BidiShape<I1,O1,I2,O2>,M> g)A graph with the shape of a BidiFlow logically is a BidiFlow, this method makes it so also in type.AttributesgetAttributes()static <A,B>
 BidiFlow<A,A,B,B,NotUsed>identity()<Mat2> Flow<I1,O2,Mat>join(Flow<O1,I2,Mat2> flow)Add the given Flow as the final step in a bidirectional transformation pipeline.<Mat2,M>
 Flow<I1,O2,M>join(Flow<O1,I2,Mat2> flow, Function2<Mat,Mat2,M> combine)Add the given Flow as the final step in a bidirectional transformation pipeline.<Mat2> BidiFlow<I1,O1,I2,O2,Mat2>mapMaterializedValue(Function<Mat,Mat2> f)Transform only the materialized value of this BidiFlow, leaving all other properties as they were.BidiFlow<I1,O1,I2,O2,Mat>named(java.lang.String name)Add anameattribute to this Flow.BidiFlow<I2,O2,I1,O1,Mat>reversed()Turn this BidiFlow around by 180 degrees, logically flipping it upside down in a protocol stack.BidiShape<I1,O1,I2,O2>shape()The shape of a graph is all that is externally visible: its inlets and outlets.org.apache.pekko.stream.impl.TraversalBuildertraversalBuilder()INTERNAL API.BidiFlow<I1,O1,I2,O2,Mat>withAttributes(Attributes attr)Change the attributes of thisSourceto the given ones and seal the list of attributes.
 
- 
- 
- 
Method Detail- 
fromGraphpublic static <I1,O1,I2,O2,M> BidiFlow<I1,O1,I2,O2,M> fromGraph(Graph<BidiShape<I1,O1,I2,O2>,M> g) A graph with the shape of a BidiFlow logically is a BidiFlow, this method makes it so also in type.
 - 
fromFlowsMatpublic static <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''. 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 | +----------------------+ | +----------------------------+
 - 
fromFlowspublic static <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 NotUsed.+----------------------------+ | Resulting BidiFlow | | | | +----------------------+ | I1 ~~> | Flow1 | ~~> O1 | +----------------------+ | | | | +----------------------+ | O2 <~~ | Flow2 | <~~ I2 | +----------------------+ | +----------------------------+
 - 
fromFunctionspublic static <I1,O1,I2,O2> BidiFlow<I1,O1,I2,O2,NotUsed> 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.
 - 
bidirectionalIdleTimeoutpublic static <I,O> BidiFlow<I,I,O,O,NotUsed> bidirectionalIdleTimeout(scala.concurrent.duration.FiniteDuration timeout) Deprecated.Use the overloaded one which accepts java.time.Duration instead. Since Akka 2.5.12.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. 
 - 
bidirectionalIdleTimeoutpublic static <I,O> BidiFlow<I,I,O,O,NotUsed> bidirectionalIdleTimeout(java.time.Duration timeout) 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. 
 - 
traversalBuilderpublic org.apache.pekko.stream.impl.TraversalBuilder traversalBuilder() Description copied from interface:GraphINTERNAL API.Every materializable element must be backed by a stream layout module - Specified by:
- traversalBuilderin interface- Graph<I1,O1>
 
 - 
shapepublic BidiShape<I1,O1,I2,O2> shape() Description copied from interface:GraphThe shape of a graph is all that is externally visible: its inlets and outlets.
 - 
atoppublic <OO1,II2,Mat2> BidiFlow<I1,OO1,II2,O2,Mat> atop(BidiFlow<O1,OO1,II2,I2,Mat2> bidi) Add the given BidiFlow as the next step in a bidirectional transformation pipeline. By convention protocol stacks are growing to the left: the right most is the bottom layer, the closest to the metal.
 The materialized value of the combined+----------------------------+ | Resulting BidiFlow | | | | +------+ +------+ | I1 ~~> | | ~O1~> | | ~~> OO1 | | this | | bidi | | O2 <~~ | | <~I2~ | | <~~ II2 | +------+ +------+ | +----------------------------+BidiFlowwill be the materialized value of the current flow (ignoring the other BidiFlow’s value), useatopMatif a different strategy is needed.
 - 
atoppublic <OO1,II2,Mat2,M> BidiFlow<I1,OO1,II2,O2,M> atop(BidiFlow<O1,OO1,II2,I2,Mat2> bidi, Function2<Mat,Mat2,M> combine) Add the given BidiFlow as the next step in a bidirectional transformation 161pipeline. By convention protocol stacks are growing to the left: the right most is the bottom layer, the closest to the metal. 
 The+----------------------------+ | Resulting BidiFlow | | | | +------+ +------+ | I1 ~~> | | ~O1~> | | ~~> OO1 | | this | | bidi | | O2 <~~ | | <~I2~ | | <~~ II2 | +------+ +------+ | +----------------------------+combinefunction is used to compose the materialized values of this flow and that flow into the materialized value of the resulting BidiFlow.
 - 
joinpublic <Mat2> Flow<I1,O2,Mat> join(Flow<O1,I2,Mat2> flow) Add the given Flow as the final step in a bidirectional transformation pipeline. By convention protocol stacks are growing to the left: the right most is the bottom layer, the closest to the metal.
 The materialized value of the combined+---------------------------+ | Resulting Flow | | | | +------+ +------+ | I1 ~~> | | ~O1~> | | | | | this | | flow | | O2 <~~ | | <~I2~ | | | | +------+ +------+ | +---------------------------+Flowwill be the materialized value of the current flow (ignoring the other Flow’s value), usejoinMatif a different strategy is needed.
 - 
joinpublic <Mat2,M> Flow<I1,O2,M> join(Flow<O1,I2,Mat2> flow, Function2<Mat,Mat2,M> combine) Add the given Flow as the final step in a bidirectional transformation pipeline. By convention protocol stacks are growing to the left: the right most is the bottom layer, the closest to the metal.
 The+---------------------------+ | Resulting Flow | | | | +------+ +------+ | I1 ~~> | | ~O1~> | | | | | this | | flow | | O2 <~~ | | <~I2~ | | | | +------+ +------+ | +---------------------------+combinefunction is used to compose the materialized values of this flow and that flow into the materialized value of the resultingFlow.
 - 
reversedpublic BidiFlow<I2,O2,I1,O1,Mat> reversed() Turn this BidiFlow around by 180 degrees, logically flipping it upside down in a protocol stack.
 - 
mapMaterializedValuepublic <Mat2> BidiFlow<I1,O1,I2,O2,Mat2> mapMaterializedValue(Function<Mat,Mat2> f) Transform only the materialized value of this BidiFlow, leaving all other properties as they were.
 - 
withAttributespublic BidiFlow<I1,O1,I2,O2,Mat> withAttributes(Attributes attr) Change the attributes of thisSourceto the given ones and seal the list of attributes. This means that further calls will not be able to remove these attributes, but instead add new ones. Note that this operation has no effect on an empty Flow (because the attributes apply only to the contained processing operators).- Specified by:
- withAttributesin interface- Graph<I1,O1>
 
 - 
addAttributespublic BidiFlow<I1,O1,I2,O2,Mat> addAttributes(Attributes attr) Add the given attributes to this Source. Further calls towithAttributeswill not remove these attributes. Note that this operation has no effect on an empty Flow (because the attributes apply only to the contained processing operators).- Specified by:
- addAttributesin interface- Graph<I1,O1>
 
 - 
namedpublic BidiFlow<I1,O1,I2,O2,Mat> named(java.lang.String name) Add anameattribute to this Flow.
 - 
asyncpublic BidiFlow<I1,O1,I2,O2,Mat> async(java.lang.String dispatcher) Put an asynchronous boundary around thisFlow
 - 
asyncpublic BidiFlow<I1,O1,I2,O2,Mat> async(java.lang.String dispatcher, int inputBufferSize) Put an asynchronous boundary around thisFlow
 - 
getAttributespublic Attributes getAttributes() - Specified by:
- getAttributesin interface- Graph<I1,O1>
 
 
- 
 
-