Interface FlowOpsMat<Out,​Mat>

  • All Superinterfaces:
    FlowOps<Out,​Mat>
    All Known Implementing Classes:
    Flow, Source

    public interface FlowOpsMat<Out,​Mat>
    extends FlowOps<Out,​Mat>
    INTERNAL API: this trait will be changed in binary-incompatible ways for classes that are derived from it! Do not implement this interface outside the Akka code base!

    Binary compatibility is only maintained for callers of this trait&rsquo;s interface.

    • Method Detail

      • concatMat

        <U,​Mat2,​Mat3> FlowOpsMat concatMat​(Graph<SourceShape<U>,​Mat2> that,
                                                       scala.Function2<Mat,​Mat2,​Mat3> matF)
        Concatenate the given Source to this Flow, meaning that once this Flow&rsquo;s input is exhausted and all result elements have been generated, the Source&rsquo;s elements will be produced.

        Note that the Source is materialized together with this Flow and just kept from producing elements by asserting back-pressure until its time comes.

        If this Flow gets upstream error - no elements from the given Source will be pulled.

        Parameters:
        that - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • interleaveMat

        <U,​Mat2,​Mat3> FlowOpsMat interleaveMat​(Graph<SourceShape<U>,​Mat2> that,
                                                           int request,
                                                           scala.Function2<Mat,​Mat2,​Mat3> matF)
        Interleave is a deterministic merge of the given Source with elements of this Flow. It first emits segmentSize number of elements from this flow to downstream, then - same amount for that source, then repeat process.

        After one of upstreams is complete then all the rest elements will be emitted from the second one

        If it gets error from one of upstreams - stream completes with failure.

        Parameters:
        that - (undocumented)
        request - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • interleaveMat

        <U,​Mat2,​Mat3> FlowOpsMat interleaveMat​(Graph<SourceShape<U>,​Mat2> that,
                                                           int request,
                                                           boolean eagerClose,
                                                           scala.Function2<Mat,​Mat2,​Mat3> matF)
        Interleave is a deterministic merge of the given Source with elements of this Flow. It first emits segmentSize number of elements from this flow to downstream, then - same amount for that source, then repeat process.

        If eagerClose is false and one of the upstreams complete the elements from the other upstream will continue passing through the interleave operator. If eagerClose is true and one of the upstream complete interleave will cancel the other upstream and complete itself.

        If it gets error from one of upstreams - stream completes with failure.

        Parameters:
        that - (undocumented)
        request - (undocumented)
        eagerClose - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • mapMaterializedValue

        <Mat2> FlowOpsMat mapMaterializedValue​(scala.Function1<Mat,​Mat2> f)
        Transform the materialized value of this graph, leaving all other properties as they were.
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • mergeMat

        <U,​Mat2,​Mat3> FlowOpsMat mergeMat​(Graph<SourceShape<U>,​Mat2> that,
                                                      boolean eagerComplete,
                                                      scala.Function2<Mat,​Mat2,​Mat3> matF)
        Merge the given Source to this Flow, taking elements as they arrive from input streams, picking randomly when several elements ready.

        Parameters:
        that - (undocumented)
        eagerComplete - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • mergeMat$default$2

        <U,​Mat2,​Mat3> boolean mergeMat$default$2()
      • mergeSortedMat

        <U,​Mat2,​Mat3> FlowOpsMat mergeSortedMat​(Graph<SourceShape<U>,​Mat2> that,
                                                            scala.Function2<Mat,​Mat2,​Mat3> matF,
                                                            scala.math.Ordering<U> ord)
        Merge the given Source to this Flow, taking elements as they arrive from input streams, picking always the smallest of the available elements (waiting for one element from each side to be available). This means that possible contiguity of the input streams is not exploited to avoid waiting for elements, this merge will block when one of the inputs does not have more elements (and does not complete).

        Parameters:
        that - (undocumented)
        matF - (undocumented)
        ord - (undocumented)
        Returns:
        (undocumented)
      • monitor

        <Mat2> FlowOpsMat monitor​(scala.Function2<Mat,​FlowMonitor<Out>,​Mat2> combine)
        Deprecated.
        Use monitor() or monitorMat(combine) instead. Since 2.5.17.
        Materializes to FlowMonitor[Out] that allows monitoring of the current flow. All events are propagated by the monitor unchanged. Note that the monitor inserts a memory barrier every time it processes an event, and may therefor affect performance.

        The combine function is used to combine the FlowMonitor with this flow's materialized value.

        Parameters:
        combine - (undocumented)
        Returns:
        (undocumented)
      • monitor

        FlowOpsMat monitor()
        Materializes to (Mat, FlowMonitor[Out]), which is unlike most other operators (!), in which usually the default materialized value keeping semantics is to keep the left value (by passing Keep.left() to a *Mat version of a method). This operator is an exception from that rule and keeps both values since dropping its sole purpose is to introduce that materialized value.

        The FlowMonitor[Out] allows monitoring of the current flow. All events are propagated by the monitor unchanged. Note that the monitor inserts a memory barrier every time it processes an event, and may therefor affect performance.

        Returns:
        (undocumented)
      • monitorMat

        <Mat2> FlowOpsMat monitorMat​(scala.Function2<Mat,​FlowMonitor<Out>,​Mat2> combine)
        Materializes to FlowMonitor[Out] that allows monitoring of the current flow. All events are propagated by the monitor unchanged. Note that the monitor inserts a memory barrier every time it processes an event, and may therefor affect performance.

        The combine function is used to combine the FlowMonitor with this flow's materialized value.

        Parameters:
        combine - (undocumented)
        Returns:
        (undocumented)
      • orElseMat

        <U,​Mat2,​Mat3> FlowOpsMat orElseMat​(Graph<SourceShape<U>,​Mat2> secondary,
                                                       scala.Function2<Mat,​Mat2,​Mat3> matF)
        Provides a secondary source that will be consumed if this stream completes without any elements passing by. As soon as the first element comes through this stream, the alternative will be cancelled.

        Note that this Flow will be materialized together with the Source and just kept from producing elements by asserting back-pressure until its time comes or it gets cancelled.

        On errors the operator is failed regardless of source of the error.

        '''Emits when''' element is available from first stream or first stream closed without emitting any elements and an element is available from the second stream

        '''Backpressures when''' downstream backpressures

        '''Completes when''' the primary stream completes after emitting at least one element, when the primary stream completes without emitting and the secondary stream already has completed or when the secondary stream completes

        '''Cancels when''' downstream cancels and additionally the alternative is cancelled as soon as an element passes by from this stream.

        Parameters:
        secondary - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • prependMat

        <U,​Mat2,​Mat3> FlowOpsMat prependMat​(Graph<SourceShape<U>,​Mat2> that,
                                                        scala.Function2<Mat,​Mat2,​Mat3> matF)
        Prepend the given Source to this Flow, meaning that before elements are generated from this Flow, the Source's elements will be produced until it is exhausted, at which point Flow elements will start being produced.

        Note that this Flow will be materialized together with the Source and just kept from producing elements by asserting back-pressure until its time comes.

        If the given Source gets upstream error - no elements from this Flow will be pulled.

        Parameters:
        that - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • toMat

        <Mat2,​Mat3> Graph toMat​(Graph<SinkShape<Out>,​Mat2> sink,
                                      scala.Function2<Mat,​Mat2,​Mat3> combine)
        Connect this Flow to a Sink, concatenating the processing steps of both.
        
             +----------------------------+
             | Resulting Sink             |
             |                            |
             |  +------+        +------+  |
             |  |      |        |      |  |
         In ~~> | flow | ~Out~> | sink |  |
             |  |      |        |      |  |
             |  +------+        +------+  |
             +----------------------------+
         
        The combine function is used to compose the materialized values of this flow and that Sink into the materialized value of the resulting Sink.

        It is recommended to use the internally optimized Keep.left and Keep.right combiners where appropriate instead of manually writing functions that pass through one of the values.

        Parameters:
        sink - (undocumented)
        combine - (undocumented)
        Returns:
        (undocumented)
      • viaMat

        <T,​Mat2,​Mat3> FlowOpsMat viaMat​(Graph<FlowShape<Out,​T>,​Mat2> flow,
                                                    scala.Function2<Mat,​Mat2,​Mat3> combine)
        Transform this Flow by appending the given processing steps.
        
             +---------------------------------+
             | Resulting Flow[In, T, M2]       |
             |                                 |
             |  +------+            +------+   |
             |  |      |            |      |   |
         In ~~> | this |  ~~Out~~>  | flow |  ~~> T
             |  |   Mat|            |     M|   |
             |  +------+            +------+   |
             +---------------------------------+
         
        The combine function is used to compose the materialized values of this flow and that flow into the materialized value of the resulting Flow.

        It is recommended to use the internally optimized Keep.left and Keep.right combiners where appropriate instead of manually writing functions that pass through one of the values.

        Parameters:
        flow - (undocumented)
        combine - (undocumented)
        Returns:
        (undocumented)
      • watchTermination

        <Mat2> FlowOpsMat watchTermination​(scala.Function2<Mat,​scala.concurrent.Future<Done>,​Mat2> matF)
        Materializes to Future[Done] that completes on getting termination message. The Future completes with success when received complete message from upstream or cancel from downstream. It fails with the same error when received error message from downstream.

        It is recommended to use the internally optimized Keep.left and Keep.right combiners where appropriate instead of manually writing functions that pass through one of the values.

        Parameters:
        matF - (undocumented)
        Returns:
        (undocumented)
      • zipLatestMat

        <U,​Mat2,​Mat3> FlowOpsMat zipLatestMat​(Graph<SourceShape<U>,​Mat2> that,
                                                          scala.Function2<Mat,​Mat2,​Mat3> matF)
        Combine the elements of current flow and the given Source into a stream of tuples, picking always the latest of the elements of each source.

        Parameters:
        that - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • zipLatestWithMat

        <Out2,​Out3,​Mat2,​Mat3> FlowOpsMat zipLatestWithMat​(Graph<SourceShape<Out2>,​Mat2> that,
                                                                            scala.Function2<Out,​Out2,​Out3> combine,
                                                                            scala.Function2<Mat,​Mat2,​Mat3> matF)
        Put together the elements of current flow and the given Source into a stream of combined elements using a combiner function, picking always the latest of the elements of each source.

        Parameters:
        that - (undocumented)
        combine - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • zipMat

        <U,​Mat2,​Mat3> FlowOpsMat zipMat​(Graph<SourceShape<U>,​Mat2> that,
                                                    scala.Function2<Mat,​Mat2,​Mat3> matF)
        Combine the elements of current flow and the given Source into a stream of tuples.

        Parameters:
        that - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)
      • zipWithMat

        <Out2,​Out3,​Mat2,​Mat3> FlowOpsMat zipWithMat​(Graph<SourceShape<Out2>,​Mat2> that,
                                                                      scala.Function2<Out,​Out2,​Out3> combine,
                                                                      scala.Function2<Mat,​Mat2,​Mat3> matF)
        Put together the elements of current flow and the given Source into a stream of combined elements using a combiner function.

        Parameters:
        that - (undocumented)
        combine - (undocumented)
        matF - (undocumented)
        Returns:
        (undocumented)