trait FlowWithContextOps[+Out, +Ctx, +Mat] extends AnyRef
Shared stream operations for FlowWithContext and SourceWithContext that automatically propagate a context element with each data element.
- Source
- FlowWithContextOps.scala
- Alphabetic
- By Inheritance
- FlowWithContextOps
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- type Repr[+O, +C] = ReprMat[O, C, Mat]
- abstract type ReprMat[+O, +C, +M] <: FlowWithContextOps[O, C, M] { type ReprMat[+OO, +CC, +MatMat] = FlowWithContextOps.this.ReprMat[OO,CC,MatMat] }
Abstract Value Members
- abstract def alsoTo(that: Graph[SinkShape[Out], _], propagateCancellation: Boolean): Repr[Out, Ctx]
Data variant of
FlowOps.alsoTowith configurable cancellation propagation.Data variant of
FlowOps.alsoTowith configurable cancellation propagation.- Since
2.0.0
- See also
FlowOps.alsoTo
- abstract def alsoTo(that: Graph[SinkShape[Out], _]): Repr[Out, Ctx]
Data variant of
FlowOps.alsoToData variant of
FlowOps.alsoTo- Since
1.1.0
- See also
FlowOps.alsoTo
- abstract def alsoToContext(that: Graph[SinkShape[Ctx], _]): Repr[Out, Ctx]
Context variant of
FlowOps.alsoToContext variant of
FlowOps.alsoTo- Since
1.1.0
- See also
FlowOps.alsoTo
- 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()
- 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
FlowOps.via
- 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
combinefunction is used to compose the materialized values of this flow and that flow into the materialized value of the resulting Flow. - abstract def wireTap(that: Graph[SinkShape[Out], _]): Repr[Out, Ctx]
Data variant of
FlowOps.wireTapData variant of
FlowOps.wireTap- Since
1.1.0
- See also
FlowOps.wireTap
- abstract def wireTapContext(that: Graph[SinkShape[Ctx], _]): Repr[Out, Ctx]
Context variant of
FlowOps.wireTapContext variant of
FlowOps.wireTap- Since
1.1.0
- See also
FlowOps.wireTap
Concrete 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 FlowWithContextOps[Out, Ctx, Mat] toany2stringadd[FlowWithContextOps[Out, Ctx, Mat]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- 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()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def collect[Out2](f: PartialFunction[Out, Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.collect.Context-preserving variant of
FlowOps.collect.Note, that the context of elements that are filtered out is skipped as well.
- See also
FlowOps.collect
- def collectFirst[Out2](f: PartialFunction[Out, Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.collectFirst.Context-preserving variant of
FlowOps.collectFirst.Note, that the context of elements that are filtered out is skipped as well.
- Since
2.0.0
- See also
FlowOps.collectFirst
- def collectType[Out2](implicit tag: ClassTag[Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.collectType.Context-preserving variant of
FlowOps.collectType.Note, that the context of elements that are filtered out is skipped as well.
- Since
2.0.0
- See also
FlowOps.collectType
- def collectWhile[Out2](f: PartialFunction[Out, Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.collectWhile.Context-preserving variant of
FlowOps.collectWhile.Note, that the context of elements that are filtered out is skipped as well.
- Since
2.0.0
- See also
FlowOps.collectWhile
- def drop(n: Long): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.drop.Context-preserving variant of
FlowOps.drop.- Since
2.0.0
- See also
FlowOps.drop
- def dropRepeated(pred: (Out, Out) => Boolean): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.dropRepeated.Context-preserving variant of
FlowOps.dropRepeated.- Since
2.0.0
- See also
FlowOps.dropRepeated
- def dropRepeated(): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.dropRepeated.Context-preserving variant of
FlowOps.dropRepeated.- Since
2.0.0
- See also
FlowOps.dropRepeated
- def dropWhile(pred: (Out) => Boolean): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.dropWhile.Context-preserving variant of
FlowOps.dropWhile.- Since
2.0.0
- See also
FlowOps.dropWhile
- def dropWithin(d: FiniteDuration): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.dropWithin.Context-preserving variant of
FlowOps.dropWithin.- Since
2.0.0
- See also
FlowOps.dropWithin
- 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
- 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
- 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
- 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def filter(pred: (Out) => Boolean): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.filter.Context-preserving variant of
FlowOps.filter.Note, that the context of elements that are filtered out is skipped as well.
- See also
FlowOps.filter
- def filterNot(pred: (Out) => Boolean): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.filterNot.Context-preserving variant of
FlowOps.filterNot.Note, that the context of elements that are filtered out is skipped as well.
- See also
FlowOps.filterNot
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def grouped(n: Int): Repr[Seq[Out], Seq[Ctx]]
Context-preserving variant of
FlowOps.grouped.Context-preserving variant of
FlowOps.grouped.Each output group will be associated with a
Seqof corresponding context elements.- See also
FlowOps.grouped
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def limit(max: Long): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.limit.Context-preserving variant of
FlowOps.limit.- Since
2.0.0
- See also
FlowOps.limit
- def limitWeighted(max: Long)(costFn: (Out) => Long): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.limitWeighted.Context-preserving variant of
FlowOps.limitWeighted.- Since
2.0.0
- See also
FlowOps.limitWeighted
- def log(name: String, extract: (Out) => Any = ConstantFun.scalaIdentityFunction)(implicit log: LoggingAdapter = null): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.log.Context-preserving variant of
FlowOps.log.- See also
FlowOps.log
- def logWithMarker(name: String, marker: (Out, Ctx) => LogMarker, extract: (Out) => Any = ConstantFun.scalaIdentityFunction)(implicit log: MarkerLoggingAdapter = null): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.logWithMarker.Context-preserving variant of
FlowOps.logWithMarker.- See also
FlowOps.logWithMarker
- def map[Out2](f: (Out) => Out2): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.map.Context-preserving variant of
FlowOps.map.- See also
FlowOps.map
- def mapAsync[Out2](parallelism: Int)(f: (Out) => Future[Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.mapAsync.Context-preserving variant of
FlowOps.mapAsync.- See also
FlowOps.mapAsync
- def mapAsyncPartitioned[Out2, P](parallelism: Int)(partitioner: (Out) => P)(f: (Out, P) => Future[Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.mapAsyncPartitioned.Context-preserving variant of
FlowOps.mapAsyncPartitioned.- Since
1.1.0
- See also
FlowOps.mapAsyncPartitioned
- def mapAsyncPartitionedUnordered[Out2, P](parallelism: Int)(partitioner: (Out) => P)(f: (Out, P) => Future[Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.mapAsyncPartitionedUnordered.Context-preserving variant of
FlowOps.mapAsyncPartitionedUnordered.- Since
1.1.0
- See also
FlowOps.mapAsyncPartitionedUnordered
- def mapConcat[Out2](f: (Out) => IterableOnce[Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.mapConcat.Context-preserving variant of
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
FlowOps.mapConcat
- def mapContext[Ctx2](f: (Ctx) => Ctx2): Repr[Out, Ctx2]
Apply the given function to each context element (leaving the data elements unchanged).
- def mapError(pf: PartialFunction[Throwable, Throwable]): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.mapError.Context-preserving variant of
FlowOps.mapError.- See also
FlowOps.mapError
- def mapOption[Out2](f: (Out) => Option[Out2]): Repr[Out2, Ctx]
Context-preserving variant of
FlowOps.mapOption.Context-preserving variant of
FlowOps.mapOption.Note, that the context of elements that are filtered out is skipped as well.
- Since
2.0.0
- See also
FlowOps.mapOption
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def sliding(n: Int, step: Int = 1): Repr[Seq[Out], Seq[Ctx]]
Context-preserving variant of
FlowOps.sliding.Context-preserving variant of
FlowOps.sliding.Each output group will be associated with a
Seqof corresponding context elements.- See also
FlowOps.sliding
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def take(n: Long): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.take.Context-preserving variant of
FlowOps.take.- Since
2.0.0
- See also
FlowOps.take
- def takeUntil(pred: (Out) => Boolean): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.takeUntil.Context-preserving variant of
FlowOps.takeUntil.- Since
2.0.0
- See also
FlowOps.takeUntil
- def takeWhile(pred: (Out) => Boolean, inclusive: Boolean): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.takeWhile.Context-preserving variant of
FlowOps.takeWhile.- Since
2.0.0
- See also
FlowOps.takeWhile
- def takeWhile(pred: (Out) => Boolean): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.takeWhile.Context-preserving variant of
FlowOps.takeWhile.- Since
2.0.0
- See also
FlowOps.takeWhile
- def takeWithin(d: FiniteDuration): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.takeWithin.Context-preserving variant of
FlowOps.takeWithin.- Since
2.0.0
- See also
FlowOps.takeWithin
- def throttle(cost: Int, per: FiniteDuration, maximumBurst: Int, costCalculation: (Out) => Int, mode: ThrottleMode): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.throttle.Context-preserving variant of
FlowOps.throttle.- See also
FlowOps.throttle
- def throttle(cost: Int, per: FiniteDuration, costCalculation: (Out) => Int): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.throttle.Context-preserving variant of
FlowOps.throttle.- See also
FlowOps.throttle
- def throttle(elements: Int, per: FiniteDuration, maximumBurst: Int, mode: ThrottleMode): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.throttle.Context-preserving variant of
FlowOps.throttle.- See also
FlowOps.throttle
- def throttle(elements: Int, per: FiniteDuration): Repr[Out, Ctx]
Context-preserving variant of
FlowOps.throttle.Context-preserving variant of
FlowOps.throttle.- See also
FlowOps.throttle
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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 withFilter(pred: (Out) => Boolean): Repr[Out, Ctx]
Alias for filter, added to enable filtering in for comprehensions.
Alias for filter, added to enable filtering in for comprehensions.
- Annotations
- @ApiMayChange()
- Since
2.0.0
- See also
FlowOps.withFilter
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 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 ofvalue.formatted(formatString), or use thef""string interpolator. In Java 15 and later,formattedresolves to the new method in String which has reversed parameters.
- 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.