Class FlowWithContext$

java.lang.Object
org.apache.pekko.stream.javadsl.FlowWithContext$

public class FlowWithContext$ extends Object
  • Field Details

    • MODULE$

      public static final FlowWithContext$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • FlowWithContext$

      public FlowWithContext$()
  • Method Details

    • create

      public <In, Ctx> FlowWithContext<In,Ctx,In,Ctx,NotUsed> create()
    • fromPairs

      public <In, CtxIn, Out, CtxOut, Mat> FlowWithContext<In,CtxIn,Out,CtxOut,Mat> fromPairs(Flow<Pair<In,CtxIn>,Pair<Out,CtxOut>,Mat> under)
      Creates a FlowWithContext from a regular flow that operates on Pair<data, context> elements.
    • unsafeOptionalDataVia

      public <FIn, FOut, FViaOut, Ctx, FMat, FViaMat, Mat> FlowWithContext<FIn,Ctx,Optional<FViaOut>,Ctx,Mat> unsafeOptionalDataVia(FlowWithContext<FIn,Ctx,Optional<FOut>,Ctx,FMat> flow, Flow<FOut,FViaOut,FViaMat> viaFlow, 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 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
      combine - 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 Optional which indicates whether the original flow's element had viaFlow applied.
      Since:
      1.1.0