Interface SubFlow<Out,​Mat,​F,​C>

  • All Superinterfaces:
    FlowOps<Out,​Mat>
    All Known Implementing Classes:
    SubFlowImpl

    public interface SubFlow<Out,​Mat,​F,​C>
    extends FlowOps<Out,​Mat>
    Attach a Sink to each sub-flow, closing the overall Graph that is being constructed.

    Note that attributes set on the returned graph, including async boundaries are now for the entire graph and not the SubFlow. for example async will not have any effect as the returned graph is the entire, closed graph.

    • Method Detail

      • concatSubstreams

        F concatSubstreams()
        Flatten the sub-flows back into the super-flow by concatenating them. This is usually a bad idea when combined with groupBy since it can easily lead to deadlock—the concatenation does not consume from the second substream until the first has finished and the groupBy operator will get back-pressure from the second stream.

        This is identical in effect to mergeSubstreamsWithParallelism(1).

        Returns:
        (undocumented)
      • mergeSubstreams

        F mergeSubstreams()
        Flatten the sub-flows back into the super-flow by performing a merge without parallelism limit (i.e. having an unbounded number of sub-flows active concurrently).

        This is identical in effect to mergeSubstreamsWithParallelism(Integer.MAX_VALUE).

        Returns:
        (undocumented)
      • mergeSubstreamsWithParallelism

        F mergeSubstreamsWithParallelism​(int parallelism)
        Flatten the sub-flows back into the super-flow by performing a merge with the given parallelism limit. This means that only up to parallelism substreams will be executed at any given time. Substreams that are not yet executed are also not materialized, meaning that back-pressure will be exerted at the operator that creates the substreams when the parallelism limit is reached.
        Parameters:
        parallelism - (undocumented)
        Returns:
        (undocumented)
      • to

        <M> C to​(Graph<SinkShape<Out>,​M> sink)
        Attach a Sink to each sub-flow, closing the overall Graph that is being constructed.

        Note that attributes set on the returned graph, including async boundaries are now for the entire graph and not the SubFlow. for example async will not have any effect as the returned graph is the entire, closed graph.

        Specified by:
        to in interface FlowOps<Out,​Mat>
        Parameters:
        sink - (undocumented)
        Returns:
        (undocumented)