Class FlowWithContext$

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

public class FlowWithContext$ extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FlowWithContext$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <In, Ctx> FlowWithContext<In,Ctx,In,Ctx,NotUsed>
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

    • apply

      public <In, Ctx> FlowWithContext<In,Ctx,In,Ctx,NotUsed> apply()
      Creates an "empty" FlowWithContext that passes elements through with their context unchanged.
    • fromTuples

      public <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.
    • unsafeOptionalDataVia

      public <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.

      '''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 Option which indicates whether the original flow's element had viaFlow applied.
      Since:
      1.1.0