Interface FlowOpsMat<Out,Mat>
-
- All Superinterfaces:
FlowOps<Out,Mat>
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’s interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <Mat2,Mat3>
FlowOpsMatalsoToMat(Graph<SinkShape<Out>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
<U,Mat2,Mat3>
FlowOpsMatconcatLazyMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
<U,Mat2,Mat3>
FlowOpsMatconcatMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
<Mat2,Mat3>
FlowOpsMatdivertToMat(Graph<SinkShape<Out>,Mat2> that, scala.Function1<Out,java.lang.Object> when, scala.Function2<Mat,Mat2,Mat3> matF)
<Out2,Mat2,Mat3>
FlowOpsMatflatMapPrefixMat(int n, scala.Function1<scala.collection.immutable.Seq<Out>,Flow<Out,Out2,Mat2>> f, scala.Function2<Mat,scala.concurrent.Future<Mat2>,Mat3> matF)
mat version ofFlowOps.flatMapPrefix(int, scala.Function1<scala.collection.immutable.Seq<Out>, akka.stream.scaladsl.Flow<Out, Out2, Mat2>>)
, this method gives access to a future materialized value of the downstream flow.<U,Mat2,Mat3>
FlowOpsMatinterleaveMat(Graph<SourceShape<U>,Mat2> that, int segmentSize, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
<U,Mat2,Mat3>
FlowOpsMatinterleaveMat(Graph<SourceShape<U>,Mat2> that, int segmentSize, scala.Function2<Mat,Mat2,Mat3> matF)
<Mat2> FlowOpsMat
mapMaterializedValue(scala.Function1<Mat,Mat2> f)
Transform the materialized value of this graph, leaving all other properties as they were.<U,Mat2,Mat3>
FlowOpsMatmergeLatestMat(Graph<SourceShape<U>,Mat2> that, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
MergeLatest joins elements from N input streams into stream of lists of size N.<U,Mat2,Mat3>
FlowOpsMatmergeMat(Graph<SourceShape<U>,Mat2> that, boolean eagerComplete, scala.Function2<Mat,Mat2,Mat3> matF)
<U,Mat2,Mat3>
booleanmergeMat$default$2()
<U,Mat2,Mat3>
FlowOpsMatmergePreferredMat(Graph<SourceShape<U>,Mat2> that, boolean preferred, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
Merge two sources.<U,Mat2,Mat3>
FlowOpsMatmergePrioritizedMat(Graph<SourceShape<U>,Mat2> that, int leftPriority, int rightPriority, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
Merge two sources.<U,Mat2,Mat3>
FlowOpsMatmergeSortedMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF, scala.math.Ordering<U> ord)
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 passingKeep.left()
to a*Mat
version of a method).<Mat2> FlowOpsMat
monitorMat(scala.Function2<Mat,FlowMonitor<Out>,Mat2> combine)
Materializes toFlowMonitor[Out]
that allows monitoring of the current flow.<U,Mat2,Mat3>
FlowOpsMatorElseMat(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.<U,Mat2,Mat3>
FlowOpsMatprependLazyMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
<U,Mat2,Mat3>
FlowOpsMatprependMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
<Mat2,Mat3>
GraphtoMat(Graph<SinkShape<Out>,Mat2> sink, scala.Function2<Mat,Mat2,Mat3> combine)
<T,Mat2,Mat3>
FlowOpsMatviaMat(Graph<FlowShape<Out,T>,Mat2> flow, scala.Function2<Mat,Mat2,Mat3> combine)
Transform thisFlow
by appending the given processing steps.<Mat2> FlowOpsMat
watchTermination(scala.Function2<Mat,scala.concurrent.Future<Done>,Mat2> matF)
Materializes toFuture[Done]
that completes on getting termination message.<Mat2,Mat3>
FlowOpsMatwireTapMat(Graph<SinkShape<Out>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
<U,Mat2,Mat3,A>
FlowOpsMatzipAllMat(Graph<SourceShape<U>,Mat2> that, A thisElem, U thatElem, scala.Function2<Mat,Mat2,Mat3> matF)
Combine the elements of current flow and the givenSource
into a stream of tuples.<U,Mat2,Mat3>
FlowOpsMatzipLatestMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Combine the elements of current flow and the givenSource
into a stream of tuples, picking always the latest of the elements of each source.<Out2,Out3,Mat2,Mat3>
FlowOpsMatzipLatestWithMat(Graph<SourceShape<Out2>,Mat2> that, boolean eagerComplete, scala.Function2<Out,Out2,Out3> combine, scala.Function2<Mat,Mat2,Mat3> matF)
Put together the elements of current flow and the givenSource
into a stream of combined elements using a combiner function, picking always the latest of the elements of each source.<Out2,Out3,Mat2,Mat3>
FlowOpsMatzipLatestWithMat(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 givenSource
into a stream of combined elements using a combiner function, picking always the latest of the elements of each source.<U,Mat2,Mat3>
FlowOpsMatzipMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Combine the elements of current flow and the givenSource
into a stream of tuples.<Out2,Out3,Mat2,Mat3>
FlowOpsMatzipWithMat(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 givenSource
into a stream of combined elements using a combiner function.-
Methods inherited from interface akka.stream.scaladsl.FlowOps
$plus$plus, addAttributes, aggregateWithBoundary, alsoTo, alsoToAll, alsoToGraph, ask, ask, async, backpressureTimeout, batch, batchWeighted, buffer, collect, collectType, completionTimeout, concat, concatAllLazy, concatGraph, concatLazy, conflate, conflateWithSeed, delay, delay$default$2, delayWith, detach, divertTo, divertToGraph, drop, dropWhile, dropWithin, expand, extrapolate, extrapolate$default$2, filter, filterNot, flatMapConcat, flatMapMerge, flatMapPrefix, fold, foldAsync, groupBy, groupBy, grouped, groupedWeighted, groupedWeightedWithin, groupedWeightedWithin, groupedWithin, idleTimeout, initialDelay, initialTimeout, interleave, interleave, interleaveAll, interleaveGraph, interleaveGraph$default$3, internalConcat, internalConcatAll, intersperse, intersperse, keepAlive, limit, limitWeighted, log, log$default$2, log$default$3, logWithMarker, logWithMarker$default$3, logWithMarker$default$4, map, mapAsync, mapAsyncPartitioned, mapAsyncUnordered, mapConcat, mapError, mapWithResource, merge, merge$default$2, mergeAll, mergeGraph, mergeLatest, mergeLatest$default$2, mergeLatestGraph, mergePreferred, mergePreferred$default$3, mergePreferredGraph, mergePrioritized, mergePrioritized$default$4, mergePrioritizedGraph, mergeSorted, mergeSortedGraph, named, onErrorComplete, onErrorComplete, orElse, orElseGraph, prefixAndTail, prepend, prependGraph, prependLazy, recover, recoverWith, recoverWithRetries, reduce, scan, scanAsync, sliding, sliding$default$2, splitAfter, splitAfter, splitWhen, splitWhen, statefulMap, statefulMapConcat, take, takeWhile, takeWhile, takeWithin, throttle, throttle, throttle, throttle, to, via, watch, wireTap, wireTap, wireTapGraph, withAttributes, zip, zipAll, zipAllFlow, zipGraph, zipLatest, zipLatestGraph, zipLatestWith, zipLatestWith, zipLatestWithGraph, zipLatestWithGraph, zipWith, zipWithGraph, zipWithIndex
-
-
-
-
Method Detail
-
alsoToMat
<Mat2,Mat3> FlowOpsMat alsoToMat(Graph<SinkShape<Out>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
-
concatLazyMat
<U,Mat2,Mat3> FlowOpsMat concatLazyMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Concatenate the givenSource
to thisFlow
, meaning that once this Flow’s input is exhausted and all result elements have been generated, the Source’s elements will be produced.Note that the
Source
is materialized together with this Flow, iflazy
materialization is what is needed the operator can be combined withSource.lazy
to defer materialization ofthat
.The second source is then kept from producing elements by asserting back-pressure until its time comes.
For a concat operator that is detached, use
concatMat(akka.stream.Graph<akka.stream.SourceShape<U>, Mat2>, scala.Function2<Mat, Mat2, Mat3>)
-
concatMat
<U,Mat2,Mat3> FlowOpsMat concatMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Concatenate the givenSource
to thisFlow
, meaning that once this Flow’s input is exhausted and all result elements have been generated, the Source’s elements will be produced.Note that the
Source
is materialized together with this Flow and is "detached" meaning it will in effect behave as a one element buffer in front of both the sources, that eagerly demands an element on start (so it can not be combined withSource.lazy
to defer materialization ofthat
).The second source is then kept from producing elements by asserting back-pressure until its time comes.
When needing a concat operator that is not detached use
concatLazyMat(akka.stream.Graph<akka.stream.SourceShape<U>, Mat2>, scala.Function2<Mat, Mat2, Mat3>)
-
divertToMat
<Mat2,Mat3> FlowOpsMat divertToMat(Graph<SinkShape<Out>,Mat2> that, scala.Function1<Out,java.lang.Object> when, scala.Function2<Mat,Mat2,Mat3> matF)
-
flatMapPrefixMat
<Out2,Mat2,Mat3> FlowOpsMat flatMapPrefixMat(int n, scala.Function1<scala.collection.immutable.Seq<Out>,Flow<Out,Out2,Mat2>> f, scala.Function2<Mat,scala.concurrent.Future<Mat2>,Mat3> matF)
mat version ofFlowOps.flatMapPrefix(int, scala.Function1<scala.collection.immutable.Seq<Out>, akka.stream.scaladsl.Flow<Out, Out2, Mat2>>)
, this method gives access to a future materialized value of the downstream flow. seeFlowOps.flatMapPrefix(int, scala.Function1<scala.collection.immutable.Seq<Out>, akka.stream.scaladsl.Flow<Out, Out2, Mat2>>)
for details.
-
interleaveMat
<U,Mat2,Mat3> FlowOpsMat interleaveMat(Graph<SourceShape<U>,Mat2> that, int segmentSize, scala.Function2<Mat,Mat2,Mat3> matF)
Interleave is a deterministic merge of the givenSource
with elements of thisFlow
. It first emitssegmentSize
number of elements from this flow to downstream, then - same amount forthat
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.
-
interleaveMat
<U,Mat2,Mat3> FlowOpsMat interleaveMat(Graph<SourceShape<U>,Mat2> that, int segmentSize, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
Interleave is a deterministic merge of the givenSource
with elements of thisFlow
. It first emitssegmentSize
number of elements from this flow to downstream, then - same amount forthat
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.
-
mapMaterializedValue
<Mat2> FlowOpsMat mapMaterializedValue(scala.Function1<Mat,Mat2> f)
Transform the materialized value of this graph, leaving all other properties as they were.
-
mergeLatestMat
<U,Mat2,Mat3> FlowOpsMat mergeLatestMat(Graph<SourceShape<U>,Mat2> that, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
MergeLatest joins elements from N input streams into stream of lists of size N. i-th element in list is the latest emitted element from i-th input stream. MergeLatest emits list for each element emitted from some input stream, but only after each input stream emitted at least one element.
-
mergeMat
<U,Mat2,Mat3> FlowOpsMat mergeMat(Graph<SourceShape<U>,Mat2> that, boolean eagerComplete, scala.Function2<Mat,Mat2,Mat3> matF)
-
mergeMat$default$2
<U,Mat2,Mat3> boolean mergeMat$default$2()
-
mergePreferredMat
<U,Mat2,Mat3> FlowOpsMat mergePreferredMat(Graph<SourceShape<U>,Mat2> that, boolean preferred, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
Merge two sources. Prefer one source if both sources have elements ready.
-
mergePrioritizedMat
<U,Mat2,Mat3> FlowOpsMat mergePrioritizedMat(Graph<SourceShape<U>,Mat2> that, int leftPriority, int rightPriority, boolean eagerClose, scala.Function2<Mat,Mat2,Mat3> matF)
Merge two sources. Prefer the sources depending on the 'priority' parameters.It is recommended to use the internally optimized
Keep.left
andKeep.right
combiners where appropriate instead of manually writing functions that pass through one of the values.
-
mergeSortedMat
<U,Mat2,Mat3> FlowOpsMat mergeSortedMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF, scala.math.Ordering<U> ord)
Merge the givenSource
to thisFlow
, 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).
-
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 passingKeep.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.
-
monitorMat
<Mat2> FlowOpsMat monitorMat(scala.Function2<Mat,FlowMonitor<Out>,Mat2> combine)
Materializes toFlowMonitor[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 theFlowMonitor
with this flow's materialized value.
-
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.
-
prependLazyMat
<U,Mat2,Mat3> FlowOpsMat prependLazyMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Prepend the givenSource
to thisFlow
, 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 the
Source
is materialized together with this Flow and is "detached" meaning in effect behave as a one element buffer in front of both the sources, that eagerly demands an element on start (so it can not be combined withSource.lazy
to defer materialization ofthat
).This flow will then be kept from producing elements by asserting back-pressure until its time comes.
When needing a prepend operator that is not detached use
prependLazyMat(akka.stream.Graph<akka.stream.SourceShape<U>, Mat2>, scala.Function2<Mat, Mat2, Mat3>)
-
prependMat
<U,Mat2,Mat3> FlowOpsMat prependMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Prepend the givenSource
to thisFlow
, 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 thisFlow
will be pulled.When needing a concat operator that is not detached use
prependLazyMat(akka.stream.Graph<akka.stream.SourceShape<U>, Mat2>, scala.Function2<Mat, Mat2, Mat3>)
-
toMat
<Mat2,Mat3> Graph toMat(Graph<SinkShape<Out>,Mat2> sink, scala.Function2<Mat,Mat2,Mat3> combine)
Connect thisFlow
to aSink
, concatenating the processing steps of both.
The+----------------------------+ | Resulting Sink | | | | +------+ +------+ | | | | | | | In ~~> | flow | ~Out~> | sink | | | | | | | | | +------+ +------+ | +----------------------------+
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
andKeep.right
combiners where appropriate instead of manually writing functions that pass through one of the values.
-
viaMat
<T,Mat2,Mat3> FlowOpsMat viaMat(Graph<FlowShape<Out,T>,Mat2> flow, scala.Function2<Mat,Mat2,Mat3> combine)
Transform thisFlow
by appending the given processing steps.
The+---------------------------------+ | Resulting Flow[In, T, M2] | | | | +------+ +------+ | | | | | | | In ~~> | this | ~~Out~~> | flow | ~~> T | | Mat| | M| | | +------+ +------+ | +---------------------------------+
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
andKeep.right
combiners where appropriate instead of manually writing functions that pass through one of the values.
-
watchTermination
<Mat2> FlowOpsMat watchTermination(scala.Function2<Mat,scala.concurrent.Future<Done>,Mat2> matF)
Materializes toFuture[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 propagated error when received error message from upstream or downstream.It is recommended to use the internally optimized
Keep.left
andKeep.right
combiners where appropriate instead of manually writing functions that pass through one of the values.
-
wireTapMat
<Mat2,Mat3> FlowOpsMat wireTapMat(Graph<SinkShape<Out>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Attaches the givenSink
to thisFlow
as a wire tap, meaning that elements that pass through will also be sent to the wire-tap Sink, without the latter affecting the mainline flow. If the wire-tap Sink backpressures, elements that would've been sent to it will be dropped instead.It is similar to
alsoToMat(akka.stream.Graph<akka.stream.SinkShape<Out>, Mat2>, scala.Function2<Mat, Mat2, Mat3>)
which does backpressure instead of dropping elements.
-
zipAllMat
<U,Mat2,Mat3,A> FlowOpsMat zipAllMat(Graph<SourceShape<U>,Mat2> that, A thisElem, U thatElem, scala.Function2<Mat,Mat2,Mat3> matF)
Combine the elements of current flow and the givenSource
into a stream of tuples.
-
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 givenSource
into a stream of tuples, picking always the latest of the elements of each source.
-
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 givenSource
into a stream of combined elements using a combiner function, picking always the latest of the elements of each source.
-
zipLatestWithMat
<Out2,Out3,Mat2,Mat3> FlowOpsMat zipLatestWithMat(Graph<SourceShape<Out2>,Mat2> that, boolean eagerComplete, scala.Function2<Out,Out2,Out3> combine, scala.Function2<Mat,Mat2,Mat3> matF)
Put together the elements of current flow and the givenSource
into a stream of combined elements using a combiner function, picking always the latest of the elements of each source.
-
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 givenSource
into a stream of tuples.
-
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 givenSource
into a stream of combined elements using a combiner function.
-
-