Packages

t

org.apache.pekko.stream.scaladsl

FlowWithContextOps

trait FlowWithContextOps[+Out, +Ctx, +Mat] extends AnyRef

Shared stream operations for FlowWithContext and SourceWithContext that automatically propagate a context element with each data element.

Annotations
@ccompatUsedUntil213()
Source
FlowWithContextOps.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FlowWithContextOps
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Repr[+O, +C] = ReprMat[O, C, Mat]
  2. abstract type ReprMat[+O, +C, +M] <: FlowWithContextOps[O, C, M] { type ReprMat[+OO, +CC, +MatMat] = FlowWithContextOps.this.ReprMat[OO,CC,MatMat] }

Abstract Value Members

  1. abstract def unsafeDataVia[Out2, Mat2](viaFlow: Graph[FlowShape[Out, Out2], Mat2]): Repr[Out2, Ctx]

    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.

    Annotations
    @ApiMayChange()
  2. abstract def via[Out2, Ctx2, Mat2](flow: Graph[FlowShape[(Out, Ctx), (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.

    See also

    pekko.stream.scaladsl.FlowOps.via

  3. abstract def viaMat[Out2, Ctx2, Mat2, Mat3](flow: Graph[FlowShape[(Out, Ctx), (Out2, Ctx2)], Mat2])(combine: (Mat, Mat2) => Mat3): ReprMat[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.

    See also

    pekko.stream.scaladsl.FlowOpsMat.viaMat

Concrete 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 FlowWithContextOps[Out, Ctx, Mat] toany2stringadd[FlowWithContextOps[Out, Ctx, Mat]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (FlowWithContextOps[Out, Ctx, Mat], B)
    Implicit
    This member is added by an implicit conversion from FlowWithContextOps[Out, Ctx, Mat] toArrowAssoc[FlowWithContextOps[Out, Ctx, Mat]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  8. def collect[Out2](f: PartialFunction[Out, Out2]): Repr[Out2, Ctx]

    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.

    See also

    pekko.stream.scaladsl.FlowOps.collect

  9. def ensuring(cond: (FlowWithContextOps[Out, Ctx, Mat]) => Boolean, msg: => Any): FlowWithContextOps[Out, Ctx, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContextOps[Out, Ctx, Mat] toEnsuring[FlowWithContextOps[Out, Ctx, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (FlowWithContextOps[Out, Ctx, Mat]) => Boolean): FlowWithContextOps[Out, Ctx, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContextOps[Out, Ctx, Mat] toEnsuring[FlowWithContextOps[Out, Ctx, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: => Any): FlowWithContextOps[Out, Ctx, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContextOps[Out, Ctx, Mat] toEnsuring[FlowWithContextOps[Out, Ctx, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): FlowWithContextOps[Out, Ctx, Mat]
    Implicit
    This member is added by an implicit conversion from FlowWithContextOps[Out, Ctx, Mat] toEnsuring[FlowWithContextOps[Out, Ctx, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def filter(pred: (Out) => Boolean): Repr[Out, Ctx]

    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.

    See also

    pekko.stream.scaladsl.FlowOps.filter

  16. def filterNot(pred: (Out) => Boolean): Repr[Out, Ctx]

    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.

    See also

    pekko.stream.scaladsl.FlowOps.filterNot

  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  18. def grouped(n: Int): Repr[Seq[Out], Seq[Ctx]]

    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.

    See also

    pekko.stream.scaladsl.FlowOps.grouped

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

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

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

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

  23. def map[Out2](f: (Out) => Out2): Repr[Out2, Ctx]

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

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

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

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

    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)

    See also

    pekko.stream.scaladsl.FlowOps.mapConcat

  26. def mapContext[Ctx2](f: (Ctx) => Ctx2): Repr[Out, Ctx2]

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

  27. def mapError(pf: PartialFunction[Throwable, Throwable]): Repr[Out, Ctx]

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

  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  31. def sliding(n: Int, step: Int = 1): Repr[Seq[Out], Seq[Ctx]]

    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.

    See also

    pekko.stream.scaladsl.FlowOps.sliding

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

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

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

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

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

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

  36. def throttle(elements: Int, per: FiniteDuration): Repr[Out, Ctx]

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

  37. def toString(): String
    Definition Classes
    AnyRef → Any
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  40. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

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 FlowWithContextOps[Out, Ctx, Mat] toStringFormat[FlowWithContextOps[Out, Ctx, 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): (FlowWithContextOps[Out, Ctx, Mat], B)
    Implicit
    This member is added by an implicit conversion from FlowWithContextOps[Out, Ctx, Mat] toArrowAssoc[FlowWithContextOps[Out, Ctx, 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 AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromFlowWithContextOps[Out, Ctx, Mat] to any2stringadd[FlowWithContextOps[Out, Ctx, Mat]]

Inherited by implicit conversion StringFormat fromFlowWithContextOps[Out, Ctx, Mat] to StringFormat[FlowWithContextOps[Out, Ctx, Mat]]

Inherited by implicit conversion Ensuring fromFlowWithContextOps[Out, Ctx, Mat] to Ensuring[FlowWithContextOps[Out, Ctx, Mat]]

Inherited by implicit conversion ArrowAssoc fromFlowWithContextOps[Out, Ctx, Mat] to ArrowAssoc[FlowWithContextOps[Out, Ctx, Mat]]

Ungrouped