trait FlowWithContextOps[+Ctx, +Out, +Mat] extends AnyRef
Shared stream operations for FlowWithContext and SourceWithContext that automatically propagate a context element with each data element.
API MAY CHANGE
- Annotations
- @ApiMayChange()
- Source
- FlowWithContextOps.scala
- Alphabetic
- By Inheritance
- FlowWithContextOps
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
- type Repr[+C, +O] = ReprMat[C, O, Mat]
- abstract type ReprMat[+C, +O, +M] <: FlowWithContextOps[C, O, M] { type ReprMat[+CC, +OO, +MatMat] = FlowWithContextOps.this.ReprMat[CC,OO,MatMat] }
Abstract Value Members
-
abstract
def
via[Ctx2, Out2, Mat2](flow: Graph[FlowShape[(Out, Ctx), (Out2, Ctx2)], Mat2]): Repr[Ctx2, Out2]
Transform this flow by the regular flow.
Transform this flow by the regular flow. The given flow must support manual context propagation by taking and producing tuples of (data, context).
This can be used as an escape hatch for operations that are not (yet) provided with automatic context propagation here.
- See also
-
abstract
def
viaMat[Ctx2, Out2, Mat2, Mat3](flow: Graph[FlowShape[(Out, Ctx), (Out2, Ctx2)], Mat2])(combine: (Mat, Mat2) ⇒ Mat3): ReprMat[Ctx2, Out2, Mat3]
Transform this flow by the regular flow.
Transform this flow by the regular flow. The given flow must support manual context propagation by taking and producing tuples of (data, context).
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
akka.stream.scaladsl.FlowOps.viaMat
Concrete Value Members
-
def
collect[Out2](f: PartialFunction[Out, Out2]): Repr[Ctx, Out2]
Context-preserving variant of akka.stream.scaladsl.FlowOps.collect.
Context-preserving variant of akka.stream.scaladsl.FlowOps.collect.
Note, that the context of elements that are filtered out is skipped as well.
-
def
filter(pred: (Out) ⇒ Boolean): Repr[Ctx, Out]
Context-preserving variant of akka.stream.scaladsl.FlowOps.filter.
Context-preserving variant of akka.stream.scaladsl.FlowOps.filter.
Note, that the context of elements that are filtered out is skipped as well.
-
def
filterNot(pred: (Out) ⇒ Boolean): Repr[Ctx, Out]
Context-preserving variant of akka.stream.scaladsl.FlowOps.filterNot.
Context-preserving variant of akka.stream.scaladsl.FlowOps.filterNot.
Note, that the context of elements that are filtered out is skipped as well.
-
def
grouped(n: Int): Repr[Seq[Ctx], Seq[Out]]
Context-preserving variant of akka.stream.scaladsl.FlowOps.grouped.
Context-preserving variant of akka.stream.scaladsl.FlowOps.grouped.
Each output group will be associated with a
Seqof corresponding context elements. -
def
map[Out2](f: (Out) ⇒ Out2): Repr[Ctx, Out2]
Context-preserving variant of akka.stream.scaladsl.FlowOps.map.
Context-preserving variant of akka.stream.scaladsl.FlowOps.map.
- See also
-
def
mapAsync[Out2](parallelism: Int)(f: (Out) ⇒ Future[Out2]): Repr[Ctx, Out2]
Context-preserving variant of akka.stream.scaladsl.FlowOps.mapAsync.
Context-preserving variant of akka.stream.scaladsl.FlowOps.mapAsync.
-
def
mapConcat[Out2](f: (Out) ⇒ Iterable[Out2]): Repr[Ctx, Out2]
Context-preserving variant of akka.stream.scaladsl.FlowOps.mapConcat.
Context-preserving variant of akka.stream.scaladsl.FlowOps.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)
-
def
mapContext[Ctx2](f: (Ctx) ⇒ Ctx2): Repr[Ctx2, Out]
Apply the given function to each context element (leaving the data elements unchanged).
-
def
sliding(n: Int, step: Int = 1): Repr[Seq[Ctx], Seq[Out]]
Context-preserving variant of akka.stream.scaladsl.FlowOps.sliding.
Context-preserving variant of akka.stream.scaladsl.FlowOps.sliding.
Each output group will be associated with a
Seqof corresponding context elements. -
def
statefulMapConcat[Out2](f: () ⇒ (Out) ⇒ Iterable[Out2]): Repr[Ctx, Out2]
Context-preserving variant of akka.stream.scaladsl.FlowOps.statefulMapConcat.
Context-preserving variant of akka.stream.scaladsl.FlowOps.statefulMapConcat.
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.statefulMapConcat(() => dup)
Output:
("a", 1) ("a", 1) ("b", 2) ("b", 2)