Class BidiFlow$


  • public class BidiFlow$
    extends java.lang.Object
    A graph with the shape of a flow logically is a flow, this method makes it so also in type.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static BidiFlow$ MODULE$
      Static reference to the singleton instance of this Scala 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 a scala.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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE$

        public static final BidiFlow$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • BidiFlow$

        public BidiFlow$()
    • Method Detail

      • identity

        public <A,​B> BidiFlow<A,​A,​B,​B,​NotUsed> identity()
      • 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.
        Parameters:
        graph - (undocumented)
        Returns:
        (undocumented)
      • 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
             |  +----------------------+  |
             +----------------------------+
         

        Parameters:
        flow1 - (undocumented)
        flow2 - (undocumented)
        combine - (undocumented)
        Returns:
        (undocumented)
      • 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
             |  +----------------------+  |
             +----------------------------+
         

        Parameters:
        flow1 - (undocumented)
        flow2 - (undocumented)
        Returns:
        (undocumented)
      • 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.
        Parameters:
        outbound - (undocumented)
        inbound - (undocumented)
        Returns:
        (undocumented)
      • 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 a scala.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.

        Parameters:
        timeout - (undocumented)
        Returns:
        (undocumented)