final class FlowWithContext[In, CtxIn, Out, CtxOut, +Mat] extends GraphDelegate[FlowShape[Pair[In, CtxIn], Pair[Out, CtxOut]], Mat]
A flow that provides operations which automatically propagate the context of an element. Only a subset of common operations from Flow is supported. As an escape hatch you can use FlowWithContext.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
- Alphabetic
- By Inheritance
- FlowWithContext
- GraphDelegate
- Graph
- AnyRef
- Any
- by GraphMapMatVal
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- 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
- 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()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addAttributes(attr: Attributes): Graph[FlowShape[Pair[In, CtxIn], Pair[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
- def asFlow(): Flow[Pair[In, CtxIn], Pair[Out, CtxOut], Mat]
Creates a regular flow of pairs (data, context).
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asScala: scaladsl.FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
- def async(dispatcher: String, inputBufferSize: Int): Graph[FlowShape[Pair[In, CtxIn], Pair[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
- def async(dispatcher: String): Graph[FlowShape[Pair[In, CtxIn], Pair[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
- def async: Graph[FlowShape[Pair[In, CtxIn], Pair[Out, CtxOut]], Mat]
Put an asynchronous boundary around this
Graph
Put an asynchronous boundary around this
Graph
- Definition Classes
- Graph
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def collect[Out2](pf: PartialFunction[Out, Out2]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.collect.
Context-preserving variant of akka.stream.javadsl.Flow.collect.
Note, that the context of elements that are filtered out is skipped as well.
- See also
- 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
- 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
- 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
- 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def filter(p: Predicate[Out]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.filter.
Context-preserving variant of akka.stream.javadsl.Flow.filter.
Note, that the context of elements that are filtered out is skipped as well.
- See also
- def filterNot(p: Predicate[Out]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.filterNot.
Context-preserving variant of akka.stream.javadsl.Flow.filterNot.
Note, that the context of elements that are filtered out is skipped as well.
- def getAttributes: Attributes
- Definition Classes
- Graph
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def grouped(n: Int): FlowWithContext[In, CtxIn, List[Out], List[CtxOut], Mat]
Context-preserving variant of akka.stream.javadsl.Flow.grouped.
Context-preserving variant of akka.stream.javadsl.Flow.grouped.
Each output group will be associated with a
Seq
of corresponding context elements.- See also
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log(name: String): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.log.
Context-preserving variant of akka.stream.javadsl.Flow.log.
- See also
- def log(name: String, log: LoggingAdapter): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.log.
Context-preserving variant of akka.stream.javadsl.Flow.log.
- See also
- def log(name: String, extract: Function[Out, Any]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.log.
Context-preserving variant of akka.stream.javadsl.Flow.log.
- See also
- def log(name: String, extract: Function[Out, Any], log: LoggingAdapter): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.log.
Context-preserving variant of akka.stream.javadsl.Flow.log.
- See also
- def logWithMarker(name: String, marker: Function2[Out, CtxOut, LogMarker]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
- def logWithMarker(name: String, marker: Function2[Out, CtxOut, LogMarker], log: MarkerLoggingAdapter): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
- def logWithMarker(name: String, marker: Function2[Out, CtxOut, LogMarker], extract: Function[Out, Any]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
- def logWithMarker(name: String, marker: Function2[Out, CtxOut, LogMarker], extract: Function[Out, Any], log: MarkerLoggingAdapter): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
Context-preserving variant of akka.stream.javadsl.Flow.logWithMarker.
- def map[Out2](f: Function[Out, Out2]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.map.
Context-preserving variant of akka.stream.javadsl.Flow.map.
- See also
- def mapAsync[Out2](parallelism: Int, f: Function[Out, CompletionStage[Out2]]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.mapAsync
Context-preserving variant of akka.stream.javadsl.Flow.mapAsync
- def mapAsyncPartitioned[Out2, P](parallelism: Int, perPartition: Int, partitioner: Function[Out, P], f: BiFunction[Out, P, CompletionStage[Out2]]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.mapAsyncPartitioned
Context-preserving variant of akka.stream.javadsl.Flow.mapAsyncPartitioned
- def mapConcat[Out2](f: Function[Out, _ <: Iterable[Out2]]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.mapConcat.
Context-preserving variant of akka.stream.javadsl.Flow.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[CtxOut2](extractContext: Function[CtxOut, CtxOut2]): FlowWithContext[In, CtxIn, Out, CtxOut2, Mat]
Apply the given function to each context element (leaving the data elements unchanged).
- def mapError(pf: PartialFunction[Throwable, Throwable]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.mapError.
Context-preserving variant of akka.stream.javadsl.Flow.mapError.
- def mapMaterializedValue[Mat2](f: Function[Mat, Mat2]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat2]
Context-preserving variant of akka.stream.javadsl.Flow.mapMaterializedValue.
Context-preserving variant of akka.stream.javadsl.Flow.mapMaterializedValue.
- def named(name: String): Graph[FlowShape[Pair[In, CtxIn], Pair[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. #none is returned.
- Definition Classes
- Graph
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def shape: FlowShape[Pair[In, CtxIn], Pair[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
- def sliding(n: Int, step: Int = 1): FlowWithContext[In, CtxIn, List[Out], List[CtxOut], Mat]
Context-preserving variant of akka.stream.javadsl.Flow.sliding.
Context-preserving variant of akka.stream.javadsl.Flow.sliding.
Each output group will be associated with a
Seq
of corresponding context elements.- See also
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def throttle(cost: Int, per: Duration, maximumBurst: Int, costCalculation: Function[Out, Integer], mode: ThrottleMode): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
- def throttle(cost: Int, per: Duration, costCalculation: Function[Out, Integer]): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
- def throttle(elements: Int, per: Duration, maximumBurst: Int, mode: ThrottleMode): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
- def throttle(elements: Int, per: Duration): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
Context-preserving variant of akka.stream.javadsl.Flow.throttle.
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unsafeDataVia[Out2, Mat2](viaFlow: Graph[FlowShape[Out, Out2], Mat2]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat]
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://doc.akka.io/libraries/akka-core/current/stream/stream-context.html.
- Annotations
- @ApiMayChange()
- def via[Out2, CtxOut2, Mat2](viaFlow: Graph[FlowShape[Pair[Out, CtxOut], Pair[Out2, CtxOut2]], Mat2]): FlowWithContext[In, CtxIn, Out2, CtxOut2, Mat]
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 behaviour that is not expected by the downstream elements, such as reordering. For more background on these requirements see https://doc.akka.io/libraries/akka-core/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
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withAttributes(attr: Attributes): FlowWithContext[In, CtxIn, Out, CtxOut, Mat]
Context-preserving variant of akka.stream.javadsl.Flow.withAttributes.
Context-preserving variant of akka.stream.javadsl.Flow.withAttributes.
- Definition Classes
- FlowWithContext → Graph
- See also
Shadowed Implicit Value Members
- def mapMaterializedValue[M2](f: (Mat) => M2): Graph[FlowShape[Pair[In, CtxIn], Pair[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[Pair[In, CtxIn], Pair[Out, CtxOut]], Mat] performed by method GraphMapMatVal in akka.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[Pair[In, CtxIn], Pair[Out, CtxOut]], Mat]).mapMaterializedValue(f)
- Definition Classes
- GraphMapMatVal
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- 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 ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- 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.