Package org.apache.pekko.stream.javadsl
Class SourceWithContext$
java.lang.Object
org.apache.pekko.stream.javadsl.SourceWithContext$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SourceWithContext$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<Out,CtxOut, Mat>
SourceWithContext<Out,CtxOut, Mat> Creates a SourceWithContext from a regular flow that operates onPair<data, context>elements.<SOut,FOut, Ctx, SMat, FMat, Mat>
SourceWithContext<Optional<FOut>,Ctx, Mat> unsafeOptionalDataVia(SourceWithContext<Optional<SOut>, Ctx, SMat> source, Flow<SOut, FOut, FMat> viaFlow, Function2<SMat, FMat, Mat> combine) 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.
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
SourceWithContext$
public SourceWithContext$()
-
-
Method Details
-
fromPairs
public <Out,CtxOut, SourceWithContext<Out,Mat> CtxOut, fromPairsMat> (Source<Pair<Out, CtxOut>, Mat> under) Creates a SourceWithContext from a regular flow that operates onPair<data, context>elements. -
unsafeOptionalDataVia
public <SOut,FOut, SourceWithContext<Optional<FOut>,Ctx, SMat, FMat, Mat> Ctx, unsafeOptionalDataViaMat> (SourceWithContext<Optional<SOut>, Ctx, SMat> source, Flow<SOut, FOut, FMat> viaFlow, Function2<SMat, FMat, Mat> combine) 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 runs with defined elements
'''Backpressures when''' the viaFlow runs for the defined elements and downstream backpressures
'''Completes when''' upstream completes
'''Cancels when''' downstream cancels
- Parameters:
source- The base source that outputs an optional elementviaFlow- 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 elementcombine- How to combine the materialized values of source and viaFlow- Returns:
- a SourceWithContext with the viaFlow applied onto defined elements of the flow. The output value is contained within an Optional which indicates whether the original source's element had viaFlow applied.
- Since:
- 1.1.0
-