Class

akka.stream.scaladsl

SourceWithContext

Related Doc: package scaladsl

Permalink

final class SourceWithContext[+Ctx, +Out, +Mat] extends GraphDelegate[SourceShape[(Out, Ctx)], Mat] with FlowWithContextOps[Ctx, Out, Mat]

A source 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.

Can be created by calling Source.startContextPropagation()

API MAY CHANGE

Annotations
@ApiMayChange()
Source
SourceWithContext.scala
Linear Supertypes
FlowWithContextOps[Ctx, Out, Mat], GraphDelegate[SourceShape[(Out, Ctx)], Mat], Graph[SourceShape[(Out, Ctx)], Mat], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SourceWithContext
  2. FlowWithContextOps
  3. GraphDelegate
  4. Graph
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Repr[+C, +O] = ReprMat[C, O, Mat]

    Permalink
    Definition Classes
    FlowWithContextOps
  2. type ReprMat[+C, +O, +M] = SourceWithContext[C, O, M]

    Permalink
    Definition Classes
    SourceWithContextFlowWithContextOps
  3. type Shape = SourceShape[(Out, Ctx)]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to any2stringadd[SourceWithContext[Ctx, Out, Mat]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (SourceWithContext[Ctx, Out, Mat], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to ArrowAssoc[SourceWithContext[Ctx, Out, Mat]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def addAttributes(attr: Attributes): Graph[SourceShape[(Out, Ctx)], Mat]

    Permalink

    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. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def asJava[JCtx >: Ctx, JOut >: Out, JMat >: Mat]: javadsl.SourceWithContext[JCtx, JOut, JMat]

    Permalink
  9. def async(dispatcher: String, inputBufferSize: Int): Graph[SourceShape[(Out, Ctx)], Mat]

    Permalink

    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
  10. def async(dispatcher: String): Graph[SourceShape[(Out, Ctx)], Mat]

    Permalink

    Put an asynchronous boundary around this Graph

    Put an asynchronous boundary around this Graph

    dispatcher

    Run the graph on this dispatcher

    Definition Classes
    Graph
  11. def async: Graph[SourceShape[(Out, Ctx)], Mat]

    Permalink

    Put an asynchronous boundary around this Graph

    Put an asynchronous boundary around this Graph

    Definition Classes
    Graph
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def collect[Out2](f: PartialFunction[Out, Out2]): Repr[Ctx, Out2]

    Permalink

    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.

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.collect

  14. def endContextPropagation: Source[(Out, Ctx), Mat]

    Permalink

    Stops automatic context propagation from here and converts this to a regular stream of a pair of (data, context).

  15. def ensuring(cond: (SourceWithContext[Ctx, Out, Mat]) ⇒ Boolean, msg: ⇒ Any): SourceWithContext[Ctx, Out, Mat]

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to Ensuring[SourceWithContext[Ctx, Out, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: (SourceWithContext[Ctx, Out, Mat]) ⇒ Boolean): SourceWithContext[Ctx, Out, Mat]

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to Ensuring[SourceWithContext[Ctx, Out, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean, msg: ⇒ Any): SourceWithContext[Ctx, Out, Mat]

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to Ensuring[SourceWithContext[Ctx, Out, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean): SourceWithContext[Ctx, Out, Mat]

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to Ensuring[SourceWithContext[Ctx, Out, Mat]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  21. def filter(pred: (Out) ⇒ Boolean): Repr[Ctx, Out]

    Permalink

    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.

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.filter

  22. def filterNot(pred: (Out) ⇒ Boolean): Repr[Ctx, Out]

    Permalink

    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.

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.filterNot

  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to StringFormat[SourceWithContext[Ctx, Out, Mat]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def grouped(n: Int): Repr[Seq[Ctx], Seq[Out]]

    Permalink

    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 Seq of corresponding context elements.

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.grouped

  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def map[Out2](f: (Out) ⇒ Out2): Repr[Ctx, Out2]

    Permalink

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

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

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.map

  30. def mapAsync[Out2](parallelism: Int)(f: (Out) ⇒ Future[Out2]): Repr[Ctx, Out2]

    Permalink

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

  31. def mapConcat[Out2](f: (Out) ⇒ Iterable[Out2]): Repr[Ctx, Out2]

    Permalink

    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)

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.mapConcat

  32. def mapContext[Ctx2](f: (Ctx) ⇒ Ctx2): Repr[Ctx2, Out]

    Permalink

    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
  33. def named(name: String): Graph[SourceShape[(Out, Ctx)], Mat]

    Permalink
    Definition Classes
    Graph
  34. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  35. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. final def shape: SourceShape[(Out, Ctx)]

    Permalink

    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
  38. def sliding(n: Int, step: Int = 1): Repr[Seq[Ctx], Seq[Out]]

    Permalink

    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 Seq of corresponding context elements.

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.sliding

  39. def statefulMapConcat[Out2](f: () ⇒ (Out) ⇒ Iterable[Out2]): Repr[Ctx, Out2]

    Permalink

    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:

    val statefulRepeat: () ⇒ String ⇒ collection.immutable.Iterable[String] = () ⇒ { var counter = 0 str ⇒ { counter = counter + 1 (1 to counter).map(_ ⇒ str) } }

    Input:

    ("a", 4) ("b", 5) ("c", 6)

    inputElements.statefulMapConcat(statefulRepeat)

    Output:

    ("a", 4) ("b", 5) ("b", 5) ("c", 6) ("c", 6) ("c", 6)

    Definition Classes
    FlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.statefulMapConcat

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  42. def via[Ctx2, Out2, Mat2](viaFlow: Graph[FlowShape[(Out, Ctx), (Out2, Ctx2)], Mat2]): Repr[Ctx2, Out2]

    Permalink

    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.

    Definition Classes
    SourceWithContextFlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.via

  43. def viaMat[Ctx2, Out2, Mat2, Mat3](flow: Graph[FlowShape[(Out, Ctx), (Out2, Ctx2)], Mat2])(combine: (Mat, Mat2) ⇒ Mat3): SourceWithContext[Ctx2, Out2, Mat3]

    Permalink

    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 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
    SourceWithContextFlowWithContextOps
    See also

    akka.stream.scaladsl.FlowOps.viaMat

  44. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def withAttributes(attr: Attributes): Graph[SourceShape[(Out, Ctx)], Mat]

    Permalink
    Definition Classes
    GraphDelegate → Graph
  48. def [B](y: B): (SourceWithContext[Ctx, Out, Mat], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from SourceWithContext[Ctx, Out, Mat] to ArrowAssoc[SourceWithContext[Ctx, Out, Mat]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from FlowWithContextOps[Ctx, Out, Mat]

Inherited from GraphDelegate[SourceShape[(Out, Ctx)], Mat]

Inherited from Graph[SourceShape[(Out, Ctx)], Mat]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from SourceWithContext[Ctx, Out, Mat] to any2stringadd[SourceWithContext[Ctx, Out, Mat]]

Inherited by implicit conversion StringFormat from SourceWithContext[Ctx, Out, Mat] to StringFormat[SourceWithContext[Ctx, Out, Mat]]

Inherited by implicit conversion Ensuring from SourceWithContext[Ctx, Out, Mat] to Ensuring[SourceWithContext[Ctx, Out, Mat]]

Inherited by implicit conversion ArrowAssoc from SourceWithContext[Ctx, Out, Mat] to ArrowAssoc[SourceWithContext[Ctx, Out, Mat]]

Ungrouped