SourceWithContext

org.apache.pekko.stream.scaladsl.SourceWithContext
See theSourceWithContext companion class

Attributes

Companion
class
Source
SourceWithContext.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def fromTuples[Out, CtxOut, Mat](source: Source[(Out, CtxOut), Mat]): SourceWithContext[Out, CtxOut, Mat]

Creates a SourceWithContext from a regular source that operates on a tuple of (data, context) elements.

Creates a SourceWithContext from a regular source that operates on a tuple of (data, context) elements.

Attributes

Source
SourceWithContext.scala
def unsafeOptionalDataVia[SOut, FOut, Ctx, SMat, FMat, Mat](source: SourceWithContext[Option[SOut], Ctx, SMat], viaFlow: Flow[SOut, FOut, FMat])(combine: (SMat, FMat) => Mat): SourceWithContext[Option[FOut], Ctx, Mat]

Creates a SourceWithContext from an existing base SourceWithContext outputting an optional element and applying an additional viaFlow only if the element in the stream is defined.

Creates a SourceWithContext from an existing base SourceWithContext outputting an optional element and applying an additional viaFlow only if the element in the stream is defined.

'''Emits when''' the provided viaFlow is runs with defined elements

'''Backpressures when''' the viaFlow runs for the defined elements and downstream backpressures

'''Completes when''' upstream completes

'''Cancels when''' downstream cancels

Value parameters

combine

How to combine the materialized values of source and viaFlow

source

The base source that outputs an optional element

viaFlow

The flow that gets used if the optional element in is defined. This flow only works on the data portion of flow and ignores the context so this flow must not re-order, drop or emit multiple elements for one incoming element

Attributes

Returns

a SourceWithContext with the viaFlow applied onto defined elements of the flow. The output value is contained within an Option which indicates whether the original source's element had viaFlow applied.

Since

1.1.0

Source
SourceWithContext.scala