Packages

final class FlowWithContext[-In, -CtxIn, +Out, +CtxOut, +Mat] extends GraphDelegate[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat] with FlowWithContextOps[Out, CtxOut, Mat]

A flow that provides operations which automatically propagate the context of an element. Only a subset of common operations from FlowOps is supported. As an escape hatch you can use FlowWithContextOps.via to manually provide the context propagation for otherwise unsupported operations.

An "empty" flow can be created by calling FlowWithContext[Ctx, T].

Source
FlowWithContext.scala
Linear Supertypes
FlowWithContextOps[Out, CtxOut, Mat], GraphDelegate[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat], Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FlowWithContext
  2. FlowWithContextOps
  3. GraphDelegate
  4. Graph
  5. AnyRef
  6. Any
Implicitly
  1. by GraphMapMatVal
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new FlowWithContext(delegate: Flow[(In, CtxIn), (Out, CtxOut), Mat])

Type Members

  1. type Repr[+O, +C] = ReprMat[O, C, Mat]
    Definition Classes
    FlowWithContextOps
  2. type ReprMat[+O, +C, +M] = FlowWithContext[In, CtxIn, O, C, M]
    Definition Classes
    FlowWithContextFlowWithContextOps
  3. type Shape = FlowShape[(In, CtxIn), (Out, CtxOut)]

    Type-level accessor for the shape parameter of this graph.

    Type-level accessor for the shape parameter of this graph.

    Definition Classes
    Graph

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toany2stringadd[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (FlowWithContext[In, CtxIn, Out, CtxOut, Mat], B)
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toArrowAssoc[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def addAttributes(attr: Attributes): Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

    Add the given attributes to this Graph.

    Add the given attributes to this Graph. If the specific attribute was already present on this graph this means the added attribute will be more specific than the existing one. If this Source is a composite of multiple graphs, new attributes on the composite will be less specific than attributes set directly on the individual graphs of the composite.

    Definition Classes
    Graph
  7. def alsoTo(that: Graph[SinkShape[Out], _]): Repr[Out, CtxOut]

    Data variant of pekko.stream.scaladsl.FlowOps.alsoTo

  8. def alsoToContext(that: Graph[SinkShape[CtxOut], _]): Repr[Out, CtxOut]

    Context variant of pekko.stream.scaladsl.FlowOps.alsoTo

  9. def asFlow: Flow[(In, CtxIn), (Out, CtxOut), Mat]
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def asJava[JIn <: In, JCtxIn <: CtxIn, JOut >: Out, JCtxOut >: CtxOut, JMat >: Mat]: javadsl.FlowWithContext[JIn, JCtxIn, JOut, JCtxOut, JMat]
  12. def async(dispatcher: String, inputBufferSize: Int): Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

    Put an asynchronous boundary around this Graph

    Put an asynchronous boundary around this Graph

    dispatcher

    Run the graph on this dispatcher

    inputBufferSize

    Set the input buffer to this size for the graph

    Definition Classes
    Graph
  13. def async(dispatcher: String): Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

    Put an asynchronous boundary around this Graph

    Put an asynchronous boundary around this Graph

    dispatcher

    Run the graph on this dispatcher

    Definition Classes
    Graph
  14. def async: Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

    Put an asynchronous boundary around this Graph

    Put an asynchronous boundary around this Graph

    Definition Classes
    Graph
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  16. def collect[Out2](f: PartialFunction[Out, Out2]): Repr[Out2, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.collect.

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.collect.

    Note, that the context of elements that are filtered out is skipped as well.

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.collect

  17. def ensuring(cond: (FlowWithContext[In, CtxIn, Out, CtxOut, Mat]) => Boolean, msg: => Any): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toEnsuring[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: (FlowWithContext[In, CtxIn, Out, CtxOut, Mat]) => Boolean): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toEnsuring[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean, msg: => Any): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toEnsuring[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: Boolean): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toEnsuring[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. def filter(pred: (Out) => Boolean): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.filter.

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.filter.

    Note, that the context of elements that are filtered out is skipped as well.

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.filter

  24. def filterNot(pred: (Out) => Boolean): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.filterNot.

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.filterNot.

    Note, that the context of elements that are filtered out is skipped as well.

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.filterNot

  25. def getAttributes: Attributes
    Definition Classes
    Graph
  26. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  27. def grouped(n: Int): Repr[Seq[Out], Seq[CtxOut]]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.grouped.

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.grouped.

    Each output group will be associated with a Seq of corresponding context elements.

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.grouped

  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def log(name: String, extract: (Out) => Any = ConstantFun.scalaIdentityFunction)(implicit log: LoggingAdapter = null): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.log.

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.log.

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.log

  31. def logWithMarker(name: String, marker: (Out, CtxOut) => LogMarker, extract: (Out) => Any = ConstantFun.scalaIdentityFunction)(implicit log: MarkerLoggingAdapter = null): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.logWithMarker.

  32. def map[Out2](f: (Out) => Out2): Repr[Out2, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.map.

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.map.

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.map

  33. def mapAsync[Out2](parallelism: Int)(f: (Out) => Future[Out2]): Repr[Out2, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.mapAsync.

  34. def mapAsyncPartitioned[Out2, P](parallelism: Int)(partitioner: (Out) => P)(f: (Out, P) => Future[Out2]): Repr[Out2, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.mapAsyncPartitioned.

  35. def mapAsyncPartitionedUnordered[Out2, P](parallelism: Int)(partitioner: (Out) => P)(f: (Out, P) => Future[Out2]): Repr[Out2, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.mapAsyncPartitionedUnordered.

  36. def mapConcat[Out2](f: (Out) => IterableOnce[Out2]): Repr[Out2, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.mapConcat.

    Context-preserving variant of pekko.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)

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.mapConcat

  37. def mapContext[Ctx2](f: (CtxOut) => Ctx2): Repr[Out, Ctx2]

    Apply the given function to each context element (leaving the data elements unchanged).

    Apply the given function to each context element (leaving the data elements unchanged).

    Definition Classes
    FlowWithContextOps
  38. def mapError(pf: PartialFunction[Throwable, Throwable]): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.mapError.

  39. def mapMaterializedValue[Mat2](f: (Mat) => Mat2): FlowWithContext[In, CtxIn, Out, CtxOut, Mat2]

    Context-preserving variant of pekko.stream.scaladsl.Flow.mapMaterializedValue.

  40. def named(name: String): Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

    Specifies the name of the Graph.

    Specifies the name of the Graph. If the name is null or empty the name is ignored, i.e. Attributes.none is returned.

    Definition Classes
    Graph
  41. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  42. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  43. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  44. final def shape: FlowShape[(In, CtxIn), (Out, CtxOut)]

    The shape of a graph is all that is externally visible: its inlets and outlets.

    The shape of a graph is all that is externally visible: its inlets and outlets.

    Definition Classes
    GraphDelegate → Graph
  45. def sliding(n: Int, step: Int = 1): Repr[Seq[Out], Seq[CtxOut]]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.sliding.

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.sliding.

    Each output group will be associated with a Seq of corresponding context elements.

    Definition Classes
    FlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.sliding

  46. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  47. def throttle(cost: Int, per: FiniteDuration, maximumBurst: Int, costCalculation: (Out) => Int, mode: ThrottleMode): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.throttle.

  48. def throttle(cost: Int, per: FiniteDuration, costCalculation: (Out) => Int): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.throttle.

  49. def throttle(elements: Int, per: FiniteDuration, maximumBurst: Int, mode: ThrottleMode): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.throttle.

  50. def throttle(elements: Int, per: FiniteDuration): Repr[Out, CtxOut]

    Context-preserving variant of pekko.stream.scaladsl.FlowOps.throttle.

  51. def toString(): String
    Definition Classes
    AnyRef → Any
  52. def unsafeDataVia[Out2, Mat2](viaFlow: Graph[FlowShape[Out, Out2], Mat2]): Repr[Out2, CtxOut]

    Transform this flow by the regular flow.

    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.

    Definition Classes
    FlowWithContextFlowWithContextOps
  53. def via[Out2, Ctx2, Mat2](viaFlow: Graph[FlowShape[(Out, CtxOut), (Out2, Ctx2)], Mat2]): Repr[Out2, Ctx2]

    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).

    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.

    Definition Classes
    FlowWithContextFlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOps.via

  54. def viaMat[Out2, Ctx2, Mat2, Mat3](flow: Graph[FlowShape[(Out, CtxOut), (Out2, Ctx2)], Mat2])(combine: (Mat, Mat2) => Mat3): FlowWithContext[In, CtxIn, Out2, Ctx2, 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).

    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 combine function is used to compose the materialized values of this flow and that flow into the materialized value of the resulting Flow.

    Definition Classes
    FlowWithContextFlowWithContextOps
    See also

    pekko.stream.scaladsl.FlowOpsMat.viaMat

  55. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  56. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  57. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  58. def wireTap(that: Graph[SinkShape[Out], _]): Repr[Out, CtxOut]

    Data variant of pekko.stream.scaladsl.FlowOps.wireTap

  59. def wireTapContext(that: Graph[SinkShape[CtxOut], _]): Repr[Out, CtxOut]

    Context variant of pekko.stream.scaladsl.FlowOps.wireTap

  60. def withAttributes(attr: Attributes): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]

    Context-preserving variant of pekko.stream.scaladsl.Flow.withAttributes.

Shadowed Implicit Value Members

  1. def mapMaterializedValue[M2](f: (Mat) => M2): Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], M2]

    Transform the materialized value of this Graph, leaving all other properties as they were.

    Transform the materialized value of this Graph, leaving all other properties as they were.

    f

    function to map the graph's materialized value

    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toGraphMapMatVal[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat] performed by method GraphMapMatVal in org.apache.pekko.stream.Graph.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (flowWithContext: GraphMapMatVal[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]).mapMaterializedValue(f)
    Definition Classes
    GraphMapMatVal

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toStringFormat[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (FlowWithContext[In, CtxIn, Out, CtxOut, Mat], B)
    Implicit
    This member is added by an implicit conversion from FlowWithContext[In, CtxIn, Out, CtxOut, Mat] toArrowAssoc[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from FlowWithContextOps[Out, CtxOut, Mat]

Inherited from GraphDelegate[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

Inherited from Graph[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion GraphMapMatVal fromFlowWithContext[In, CtxIn, Out, CtxOut, Mat] to GraphMapMatVal[FlowShape[(In, CtxIn), (Out, CtxOut)], Mat]

Inherited by implicit conversion any2stringadd fromFlowWithContext[In, CtxIn, Out, CtxOut, Mat] to any2stringadd[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]]

Inherited by implicit conversion StringFormat fromFlowWithContext[In, CtxIn, Out, CtxOut, Mat] to StringFormat[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]]

Inherited by implicit conversion Ensuring fromFlowWithContext[In, CtxIn, Out, CtxOut, Mat] to Ensuring[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]]

Inherited by implicit conversion ArrowAssoc fromFlowWithContext[In, CtxIn, Out, CtxOut, Mat] to ArrowAssoc[FlowWithContext[In, CtxIn, Out, CtxOut, Mat]]

Ungrouped