Package org.apache.pekko.stream.scaladsl
Class FlowWithContext$
java.lang.Object
org.apache.pekko.stream.scaladsl.FlowWithContext$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FlowWithContext$
Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<In,
Ctx> FlowWithContext<In, Ctx, In, Ctx, NotUsed> apply()
Creates an "empty" FlowWithContext that passes elements through with their context unchanged.<In,
CtxIn, Out, CtxOut, Mat>
FlowWithContext<In,CtxIn, Out, CtxOut, Mat> fromTuples
(Flow<scala.Tuple2<In, CtxIn>, scala.Tuple2<Out, CtxOut>, Mat> flow) Creates a FlowWithContext from a regular flow that operates on a tuple of(data, context)
elements.<FIn,
FOut, FViaOut, Ctx, FMat, FViaMat, Mat>
FlowWithContext<FIn,Ctx, scala.Option<FViaOut>, Ctx, Mat> unsafeOptionalDataVia
(FlowWithContext<FIn, Ctx, scala.Option<FOut>, Ctx, FMat> flow, Flow<FOut, FViaOut, FViaMat> viaFlow, scala.Function2<FMat, FViaMat, Mat> combine) Creates a FlowWithContext from an existing base FlowWithContext 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
-
FlowWithContext$
public FlowWithContext$()
-
-
Method Details
-
apply
Creates an "empty" FlowWithContext that passes elements through with their context unchanged. -
fromTuples
public <In,CtxIn, FlowWithContext<In,Out, CtxOut, Mat> CtxIn, fromTuplesOut, CtxOut, Mat> (Flow<scala.Tuple2<In, CtxIn>, scala.Tuple2<Out, CtxOut>, Mat> flow) Creates a FlowWithContext from a regular flow that operates on a tuple of(data, context)
elements. -
unsafeOptionalDataVia
public <FIn,FOut, FlowWithContext<FIn,FViaOut, Ctx, FMat, FViaMat, Mat> Ctx, unsafeOptionalDataViascala.Option<FViaOut>, Ctx, Mat> (FlowWithContext<FIn, Ctx, scala.Option<FOut>, Ctx, FMat> flow, Flow<FOut, FViaOut, FViaMat> viaFlow, scala.Function2<FMat, FViaMat, Mat> combine) Creates a FlowWithContext from an existing base FlowWithContext 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:
flow
- The base flow 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 flow and viaFlow- Returns:
- a FlowWithContext with the viaFlow applied onto defined elements of the flow. The output value is contained within an Option which indicates whether the original flow's element had viaFlow applied.
- Since:
- 1.1.0
-