public interface FlowOpsMat<Out,Mat> extends FlowOps<Out,Mat>
Binary compatibility is only maintained for callers of this trait’s interface.
Modifier and Type | Method and Description |
---|---|
<Mat2,Mat3> |
alsoToMat(Graph<SinkShape<Out>,Mat2> that,
scala.Function2<Mat,Mat2,Mat3> matF)
|
<U,Mat2,Mat3> |
concatMat(Graph<SourceShape<U>,Mat2> that,
scala.Function2<Mat,Mat2,Mat3> matF)
|
<U,Mat2,Mat3> |
interleaveMat(Graph<SourceShape<U>,Mat2> that,
int request,
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> |
mergeMat(Graph<SourceShape<U>,Mat2> that,
boolean eagerComplete,
scala.Function2<Mat,Mat2,Mat3> matF)
|
<U,Mat2,Mat3> |
mergeSortedMat(Graph<SourceShape<U>,Mat2> that,
scala.Function2<Mat,Mat2,Mat3> matF,
scala.math.Ordering<U> ord)
|
<Mat2> FlowOpsMat |
monitor(scala.Function2<Mat,FlowMonitor<Out>,Mat2> combine)
Materializes to
FlowMonitor[Out] that allows monitoring of the current flow. |
<U,Mat2,Mat3> |
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.
|
<U,Mat2,Mat3> |
prependMat(Graph<SourceShape<U>,Mat2> that,
scala.Function2<Mat,Mat2,Mat3> matF)
|
<Mat2,Mat3> |
toMat(Graph<SinkShape<Out>,Mat2> sink,
scala.Function2<Mat,Mat2,Mat3> combine)
|
<T,M> FlowOpsMat |
transformMaterializing(scala.Function0<scala.Tuple2<Stage<Out,T>,M>> mkStageAndMaterialized)
INTERNAL API.
|
<T,Mat2,Mat3> |
viaMat(Graph<FlowShape<Out,T>,Mat2> flow,
scala.Function2<Mat,Mat2,Mat3> combine)
Transform this
Flow by appending the given processing steps. |
<Mat2> FlowOpsMat |
watchTermination(scala.Function2<Mat,scala.concurrent.Future<Done>,Mat2> matF)
Materializes to
Future[Done] that completes on getting termination message. |
<U,Mat2,Mat3> |
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. |
<Out2,Out3,Mat2,Mat3> |
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. |
addAttributes, alsoTo, alsoToGraph, andThen, async, backpressureTimeout, batch, batchWeighted, buffer, collect, completionTimeout, concat, concatGraph, conflate, conflateWithSeed, delay, detach, drop, dropWhile, dropWithin, expand, filter, filterNot, flatMapConcat, flatMapMerge, fold, foldAsync, groupBy, grouped, groupedWithin, idleTimeout, initialDelay, initialTimeout, interleave, interleaveGraph, intersperse, intersperse, keepAlive, limit, limitWeighted, log, map, mapAsync, mapAsyncUnordered, mapConcat, mapError, merge, mergeGraph, mergeSorted, mergeSortedGraph, named, orElse, orElseGraph, prefixAndTail, prepend, prependGraph, recover, recoverWith, recoverWithRetries, reduce, scan, scanAsync, sliding, splitAfter, splitAfter, splitWhen, splitWhen, statefulMapConcat, take, takeWhile, takeWhile, takeWithin, throttle, throttle, to, transform, via, withAttributes, zip, zipGraph, zipWith, zipWithGraph, zipWithIndex
<T,Mat2,Mat3> FlowOpsMat viaMat(Graph<FlowShape<Out,T>,Mat2> flow, scala.Function2<Mat,Mat2,Mat3> combine)
Flow
by appending the given processing steps.
+----------------------------+
| Resulting Flow |
| |
| +------+ +------+ |
| | | | | |
In ~~> | this | ~Out~> | flow | ~~> T
| | | | | |
| +------+ +------+ |
+----------------------------+
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.
flow
- (undocumented)combine
- (undocumented)<Mat2,Mat3> Graph toMat(Graph<SinkShape<Out>,Mat2> sink, scala.Function2<Mat,Mat2,Mat3> combine)
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.
sink
- (undocumented)combine
- (undocumented)<U,Mat2,Mat3> FlowOpsMat zipMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Source
into a stream of tuples.
that
- (undocumented)matF
- (undocumented)#zip}.
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.
<Out2,Out3,Mat2,Mat3> FlowOpsMat zipWithMat(Graph<SourceShape<Out2>,Mat2> that, scala.Function2<Out,Out2,Out3> combine, scala.Function2<Mat,Mat2,Mat3> matF)
Source
into a stream of combined elements using a combiner function.
that
- (undocumented)combine
- (undocumented)matF
- (undocumented)#zipWith}.
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.
<U,Mat2,Mat3> FlowOpsMat mergeMat(Graph<SourceShape<U>,Mat2> that, boolean eagerComplete, scala.Function2<Mat,Mat2,Mat3> matF)
Source
to this Flow
, taking elements as they arrive from input streams,
picking randomly when several elements ready.
that
- (undocumented)eagerComplete
- (undocumented)matF
- (undocumented)#merge}.
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.
<U,Mat2,Mat3> FlowOpsMat interleaveMat(Graph<SourceShape<U>,Mat2> that, int request, scala.Function2<Mat,Mat2,Mat3> matF)
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 than all the rest elements will be emitted from the second one
If it gets error from one of upstreams - stream completes with failure.
that
- (undocumented)request
- (undocumented)matF
- (undocumented)#interleave}.
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.
<U,Mat2,Mat3> FlowOpsMat mergeSortedMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF, scala.math.Ordering<U> ord)
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).
that
- (undocumented)matF
- (undocumented)ord
- (undocumented)#mergeSorted}.
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.
<U,Mat2,Mat3> FlowOpsMat concatMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Source
to this Flow
, 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 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.
that
- (undocumented)matF
- (undocumented)#concat}.
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.
<U,Mat2,Mat3> FlowOpsMat prependMat(Graph<SourceShape<U>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
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.
that
- (undocumented)matF
- (undocumented)#prepend}.
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.
<U,Mat2,Mat3> FlowOpsMat orElseMat(Graph<SourceShape<U>,Mat2> secondary, scala.Function2<Mat,Mat2,Mat3> matF)
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 stage 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.
secondary
- (undocumented)matF
- (undocumented)<Mat2,Mat3> FlowOpsMat alsoToMat(Graph<SinkShape<Out>,Mat2> that, scala.Function2<Mat,Mat2,Mat3> matF)
Sink
to this Flow
, meaning that elements that passes
through will also be sent to the Sink
.
that
- (undocumented)matF
- (undocumented)
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.
<Mat2> FlowOpsMat watchTermination(scala.Function2<Mat,scala.concurrent.Future<Done>,Mat2> matF)
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.
matF
- (undocumented)<Mat2> FlowOpsMat mapMaterializedValue(scala.Function1<Mat,Mat2> f)
f
- (undocumented)<Mat2> FlowOpsMat monitor(scala.Function2<Mat,FlowMonitor<Out>,Mat2> combine)
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.combine
- (undocumented)<T,M> FlowOpsMat transformMaterializing(scala.Function0<scala.Tuple2<Stage<Out,T>,M>> mkStageAndMaterialized)
mkStageAndMaterialized
- (undocumented)