Class SourceWithContext$


  • public class SourceWithContext$
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static SourceWithContext$ MODULE$
      Static reference to the singleton instance of this Scala object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <Out,​CtxOut,​Mat>
      SourceWithContext<Out,​CtxOut,​Mat>
      fromPairs​(Source<Pair<Out,​CtxOut>,​Mat> under)
      Creates a SourceWithContext from a regular flow that operates on Pair elements.
      <SOut,​FOut,​Ctx,​SMat,​FMat,​Mat>
      SourceWithContext<java.util.Optional<FOut>,​Ctx,​Mat>
      unsafeOptionalDataVia​(SourceWithContext<java.util.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE$

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

      • SourceWithContext$

        public SourceWithContext$()
    • Method Detail

      • fromPairs

        public <Out,​CtxOut,​Mat> SourceWithContext<Out,​CtxOut,​Mat> fromPairs​(Source<Pair<Out,​CtxOut>,​Mat> under)
        Creates a SourceWithContext from a regular flow that operates on Pair elements.
      • unsafeOptionalDataVia

        public <SOut,​FOut,​Ctx,​SMat,​FMat,​Mat> SourceWithContext<java.util.Optional<FOut>,​Ctx,​Mat> unsafeOptionalDataVia​(SourceWithContext<java.util.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 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 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