Class AkkaStreams


  • public class AkkaStreams
    extends Object
    Akka streams utilities.
    • Constructor Detail

      • AkkaStreams

        public AkkaStreams()
    • Method Detail

      • bypassWith

        public static <In,​FlowIn,​Out> Flow<In,​Out,​?> bypassWith​(Function<In,​F.Either<FlowIn,​Out>> splitter,
                                                                                        Flow<FlowIn,​Out,​?> flow)
        Bypass the given flow using the given splitter function.

        If the splitter function returns Left, they will go through the flow. If it returns Right, they will bypass the flow.

        Uses onlyFirstCanFinishMerge(2) by default.

        Type Parameters:
        In - the In type parameter for Flow
        FlowIn - the FlowIn type parameter for the left branch in Either.
        Out - the Out type parameter for Flow
        Parameters:
        flow - the original flow
        splitter - the splitter function to use
        Returns:
        the flow with a bypass.
      • bypassWith

        public static <In,​FlowIn,​Out> Flow<In,​Out,​?> bypassWith​(Flow<In,​F.Either<FlowIn,​Out>,​?> splitter,
                                                                                        Graph<UniformFanInShape<Out,​Out>,​?> mergeStrategy,
                                                                                        Flow<FlowIn,​Out,​?> flow)
        Using the given splitter flow, allow messages to bypass a flow.

        If the splitter flow produces Left, they will be fed into the flow. If it produces Right, they will bypass the flow.

        Type Parameters:
        In - the In type parameter for Flow
        FlowIn - the FlowIn type parameter for the left branch in Either.
        Out - the Out type parameter for Flow.
        Parameters:
        flow - the original flow.
        splitter - the splitter function.
        mergeStrategy - the merge strategy (onlyFirstCanFinishMerge, ignoreAfterFinish, ignoreAfterCancellation)
        Returns:
        the flow with a bypass.