Interface FlowWithContextOps<Out,Ctx,Mat>
- All Known Implementing Classes:
FlowWithContext,SourceWithContext
FlowWithContext and SourceWithContext that automatically propagate a context
element with each data element.-
Method Summary
Modifier and TypeMethodDescriptionData variant ofFlowOps.alsoToData variant ofFlowOps.alsoTowith configurable cancellation propagation.alsoToContext(Graph<SinkShape<Ctx>, ?> that) Context variant ofFlowOps.alsoTo<Out2> FlowWithContextOpsContext-preserving variant ofFlowOps.collect.<Out2> FlowWithContextOpscollectFirst(scala.PartialFunction<Out, Out2> f) Context-preserving variant ofFlowOps.collectFirst.<Out2> FlowWithContextOpscollectType(scala.reflect.ClassTag<Out2> tag) Context-preserving variant ofFlowOps.collectType.<Out2> FlowWithContextOpscollectWhile(scala.PartialFunction<Out, Out2> f) Context-preserving variant ofFlowOps.collectWhile.drop(long n) Context-preserving variant ofFlowOps.drop.Context-preserving variant ofFlowOps.dropRepeated.dropRepeated(scala.Function2<Out, Out, Object> pred) Context-preserving variant ofFlowOps.dropRepeated.Context-preserving variant ofFlowOps.dropWhile.dropWithin(scala.concurrent.duration.FiniteDuration d) Context-preserving variant ofFlowOps.dropWithin.Context-preserving variant ofFlowOps.filter.Context-preserving variant ofFlowOps.filterNot.flow()grouped(int n) Context-preserving variant ofFlowOps.grouped.limit(long max) Context-preserving variant ofFlowOps.limit.limitWeighted(long max, scala.Function1<Out, Object> costFn) Context-preserving variant ofFlowOps.limitWeighted.log(String name, scala.Function1<Out, Object> extract, LoggingAdapter log) Context-preserving variant ofFlowOps.log.log$default$3(String name, scala.Function1<Out, Object> extract) logWithMarker(String name, scala.Function2<Out, Ctx, LogMarker> marker, scala.Function1<Out, Object> extract, MarkerLoggingAdapter log) Context-preserving variant ofFlowOps.logWithMarker.logWithMarker$default$4(String name, scala.Function2<Out, Ctx, LogMarker> marker, scala.Function1<Out, Object> extract) <Out2> FlowWithContextOpsContext-preserving variant ofFlowOps.map.<Out2> FlowWithContextOpsContext-preserving variant ofFlowOps.mapAsync.<Out2,P> FlowWithContextOps mapAsyncPartitioned(int parallelism, scala.Function1<Out, P> partitioner, scala.Function2<Out, P, scala.concurrent.Future<Out2>> f) Context-preserving variant ofFlowOps.mapAsyncPartitioned.<Out2,P> FlowWithContextOps mapAsyncPartitionedUnordered(int parallelism, scala.Function1<Out, P> partitioner, scala.Function2<Out, P, scala.concurrent.Future<Out2>> f) Context-preserving variant ofFlowOps.mapAsyncPartitionedUnordered.<Out2> FlowWithContextOpsContext-preserving variant ofFlowOps.mapConcat.<Ctx2> FlowWithContextOpsmapContext(scala.Function1<Ctx, Ctx2> f) Apply the given function to each context element (leaving the data elements unchanged).Context-preserving variant ofFlowOps.mapError.<Out2> FlowWithContextOpsContext-preserving variant ofFlowOps.mapOption.sliding(int n, int step) Context-preserving variant ofFlowOps.sliding.inttake(long n) Context-preserving variant ofFlowOps.take.Context-preserving variant ofFlowOps.takeUntil.Context-preserving variant ofFlowOps.takeWhile.Context-preserving variant ofFlowOps.takeWhile.takeWithin(scala.concurrent.duration.FiniteDuration d) Context-preserving variant ofFlowOps.takeWithin.throttle(int elements, scala.concurrent.duration.FiniteDuration per) Context-preserving variant ofFlowOps.throttle.throttle(int elements, scala.concurrent.duration.FiniteDuration per, int maximumBurst, ThrottleMode mode) Context-preserving variant ofFlowOps.throttle.throttle(int cost, scala.concurrent.duration.FiniteDuration per, int maximumBurst, scala.Function1<Out, Object> costCalculation, ThrottleMode mode) Context-preserving variant ofFlowOps.throttle.throttle(int cost, scala.concurrent.duration.FiniteDuration per, scala.Function1<Out, Object> costCalculation) Context-preserving variant ofFlowOps.throttle.<Out2,Mat2>
FlowWithContextOpsunsafeDataVia(Graph<FlowShape<Out, Out2>, Mat2> viaFlow) Transform this flow by the regular flow.<Out2,Ctx2, Mat2>
FlowWithContextOpsTransform this flow by the regular flow.<Out2,Ctx2, Mat2, Mat3>
FlowWithContextOpsviaMat(Graph<FlowShape<scala.Tuple2<Out, Ctx>, scala.Tuple2<Out2, Ctx2>>, Mat2> flow, scala.Function2<Mat, Mat2, Mat3> combine) Transform this flow by the regular flow.Data variant ofFlowOps.wireTapwireTapContext(Graph<SinkShape<Ctx>, ?> that) Context variant ofFlowOps.wireTapwithFilter(scala.Function1<Out, Object> pred) Alias forfilter(scala.Function1<Out,java.lang.Object>), added to enable filtering in for comprehensions.
-
Method Details
-
alsoTo
Data variant ofFlowOps.alsoTo- Since:
- 1.1.0
- See Also:
-
FlowOps.alsoTo
-
alsoTo
Data variant ofFlowOps.alsoTowith configurable cancellation propagation.- Since:
- 2.0.0
- See Also:
-
FlowOps.alsoTo
-
alsoToContext
Context variant ofFlowOps.alsoTo- Since:
- 1.1.0
- See Also:
-
FlowOps.alsoTo
-
collect
Context-preserving variant ofFlowOps.collect.Note, that the context of elements that are filtered out is skipped as well.
- See Also:
-
FlowOps.collect
-
collectFirst
Context-preserving variant ofFlowOps.collectFirst.Note, that the context of elements that are filtered out is skipped as well.
- Since:
- 2.0.0
- See Also:
-
FlowOps.collectFirst
-
collectType
Context-preserving variant ofFlowOps.collectType.Note, that the context of elements that are filtered out is skipped as well.
- Since:
- 2.0.0
- See Also:
-
FlowOps.collectType
-
collectWhile
Context-preserving variant ofFlowOps.collectWhile.Note, that the context of elements that are filtered out is skipped as well.
- Since:
- 2.0.0
- See Also:
-
FlowOps.collectWhile
-
drop
Context-preserving variant ofFlowOps.drop.- Since:
- 2.0.0
- See Also:
-
FlowOps.drop
-
dropRepeated
FlowWithContextOps dropRepeated()Context-preserving variant ofFlowOps.dropRepeated.- Since:
- 2.0.0
- See Also:
-
FlowOps.dropRepeated
-
dropRepeated
Context-preserving variant ofFlowOps.dropRepeated.- Since:
- 2.0.0
- See Also:
-
FlowOps.dropRepeated
-
dropWhile
Context-preserving variant ofFlowOps.dropWhile.- Since:
- 2.0.0
- See Also:
-
FlowOps.dropWhile
-
dropWithin
Context-preserving variant ofFlowOps.dropWithin.- Since:
- 2.0.0
- See Also:
-
FlowOps.dropWithin
-
filter
Context-preserving variant ofFlowOps.filter.Note, that the context of elements that are filtered out is skipped as well.
- See Also:
-
FlowOps.filter
-
filterNot
Context-preserving variant ofFlowOps.filterNot.Note, that the context of elements that are filtered out is skipped as well.
- See Also:
-
FlowOps.filterNot
-
flow
-
grouped
Context-preserving variant ofFlowOps.grouped.Each output group will be associated with a
Seqof corresponding context elements.- See Also:
-
FlowOps.grouped
-
limit
Context-preserving variant ofFlowOps.limit.- Since:
- 2.0.0
- See Also:
-
FlowOps.limit
-
limitWeighted
Context-preserving variant ofFlowOps.limitWeighted.- Since:
- 2.0.0
- See Also:
-
FlowOps.limitWeighted
-
log
Context-preserving variant ofFlowOps.log.- See Also:
-
FlowOps.log
-
log$default$2
-
log$default$3
-
logWithMarker
FlowWithContextOps logWithMarker(String name, scala.Function2<Out, Ctx, LogMarker> marker, scala.Function1<Out, Object> extract, MarkerLoggingAdapter log) Context-preserving variant ofFlowOps.logWithMarker.- See Also:
-
FlowOps.logWithMarker
-
logWithMarker$default$3
-
logWithMarker$default$4
-
map
Context-preserving variant ofFlowOps.map.- See Also:
-
FlowOps.map
-
mapAsync
<Out2> FlowWithContextOps mapAsync(int parallelism, scala.Function1<Out, scala.concurrent.Future<Out2>> f) Context-preserving variant ofFlowOps.mapAsync.- See Also:
-
FlowOps.mapAsync
-
mapAsyncPartitioned
<Out2,P> FlowWithContextOps mapAsyncPartitioned(int parallelism, scala.Function1<Out, P> partitioner, scala.Function2<Out, P, scala.concurrent.Future<Out2>> f) Context-preserving variant ofFlowOps.mapAsyncPartitioned.- Since:
- 1.1.0
- See Also:
-
FlowOps.mapAsyncPartitioned
-
mapAsyncPartitionedUnordered
<Out2,P> FlowWithContextOps mapAsyncPartitionedUnordered(int parallelism, scala.Function1<Out, P> partitioner, scala.Function2<Out, P, scala.concurrent.Future<Out2>> f) Context-preserving variant ofFlowOps.mapAsyncPartitionedUnordered.- Since:
- 1.1.0
- See Also:
-
FlowOps.mapAsyncPartitionedUnordered
-
mapConcat
Context-preserving variant ofFlowOps.mapConcat.The context of the input element will be associated with each of the output elements calculated from this input element.
Example:
def dup(element: String) = Seq(element, element)Input:
("a", 1) ("b", 2)
inputElements.mapConcat(dup)
Output:
("a", 1) ("a", 1) ("b", 2) ("b", 2)
- See Also:
-
FlowOps.mapConcat
-
mapContext
Apply the given function to each context element (leaving the data elements unchanged). -
mapError
Context-preserving variant ofFlowOps.mapError.- See Also:
-
FlowOps.mapError
-
mapOption
Context-preserving variant ofFlowOps.mapOption.Note, that the context of elements that are filtered out is skipped as well.
- Since:
- 2.0.0
- See Also:
-
FlowOps.mapOption
-
sliding
Context-preserving variant ofFlowOps.sliding.Each output group will be associated with a
Seqof corresponding context elements.- See Also:
-
FlowOps.sliding
-
sliding$default$2
int sliding$default$2() -
take
Context-preserving variant ofFlowOps.take.- Since:
- 2.0.0
- See Also:
-
FlowOps.take
-
takeUntil
Context-preserving variant ofFlowOps.takeUntil.- Since:
- 2.0.0
- See Also:
-
FlowOps.takeUntil
-
takeWhile
Context-preserving variant ofFlowOps.takeWhile.- Since:
- 2.0.0
- See Also:
-
FlowOps.takeWhile
-
takeWhile
Context-preserving variant ofFlowOps.takeWhile.- Since:
- 2.0.0
- See Also:
-
FlowOps.takeWhile
-
takeWithin
Context-preserving variant ofFlowOps.takeWithin.- Since:
- 2.0.0
- See Also:
-
FlowOps.takeWithin
-
throttle
Context-preserving variant ofFlowOps.throttle.- See Also:
-
FlowOps.throttle
-
throttle
FlowWithContextOps throttle(int elements, scala.concurrent.duration.FiniteDuration per, int maximumBurst, ThrottleMode mode) Context-preserving variant ofFlowOps.throttle.- See Also:
-
FlowOps.throttle
-
throttle
FlowWithContextOps throttle(int cost, scala.concurrent.duration.FiniteDuration per, scala.Function1<Out, Object> costCalculation) Context-preserving variant ofFlowOps.throttle.- See Also:
-
FlowOps.throttle
-
throttle
FlowWithContextOps throttle(int cost, scala.concurrent.duration.FiniteDuration per, int maximumBurst, scala.Function1<Out, Object> costCalculation, ThrottleMode mode) Context-preserving variant ofFlowOps.throttle.- See Also:
-
FlowOps.throttle
-
unsafeDataVia
Transform this flow by the regular flow. The given flow works on the data portion of the stream and ignores the context.The given flow *must* not re-order, drop or emit multiple elements for one incoming element, the sequence of incoming contexts is re-combined with the outgoing elements of the stream. If a flow not fulfilling this requirement is used the stream will not fail but continue running in a corrupt state and re-combine incorrect pairs of elements and contexts or deadlock.
For more background on these requirements see https://pekko.apache.org/docs/pekko/current/stream/stream-context.html.
-
via
<Out2,Ctx2, FlowWithContextOps viaMat2> (Graph<FlowShape<scala.Tuple2<Out, Ctx>, scala.Tuple2<Out2, Ctx2>>, Mat2> flow) Transform this flow by the regular flow. The given flow must support manual context propagation by taking and producing tuples of (data, context).It is up to the implementer to ensure the inner flow does not exhibit any behavior that is not expected by the downstream elements, such as reordering. For more background on these requirements see https://pekko.apache.org/docs/pekko/current/stream/stream-context.html.
This can be used as an escape hatch for operations that are not (yet) provided with automatic context propagation here.
- See Also:
-
FlowOps.via
-
viaMat
<Out2,Ctx2, FlowWithContextOps viaMatMat2, Mat3> (Graph<FlowShape<scala.Tuple2<Out, Ctx>, scala.Tuple2<Out2, Ctx2>>, Mat2> flow, scala.Function2<Mat, Mat2, Mat3> combine) Transform this flow by the regular flow. The given flow must support manual context propagation by taking and producing tuples of (data, context).It is up to the implementer to ensure the inner flow does not exhibit any behavior that is not expected by the downstream elements, such as reordering. For more background on these requirements see https://pekko.apache.org/docs/pekko/current/stream/stream-context.html.
This can be used as an escape hatch for operations that are not (yet) provided with automatic context propagation here.
The
combinefunction is used to compose the materialized values of this flow and that flow into the materialized value of the resulting Flow.- See Also:
-
pekko.stream.scaladsl.FlowOpsMat.viaMat
-
wireTap
Data variant ofFlowOps.wireTap- Since:
- 1.1.0
- See Also:
-
FlowOps.wireTap
-
wireTapContext
Context variant ofFlowOps.wireTap- Since:
- 1.1.0
- See Also:
-
FlowOps.wireTap
-
withFilter
Alias forfilter(scala.Function1<Out,java.lang.Object>), added to enable filtering in for comprehensions.- Since:
- 2.0.0
- See Also:
-
FlowOps.withFilter
-