Class MergePrioritized<T>

  • All Implemented Interfaces:
    Graph<UniformFanInShape<T,​T>,​NotUsed>

    public final class MergePrioritized<T>
    extends GraphStage<UniformFanInShape<T,​T>>
    Merge several streams, taking elements as they arrive from input streams (picking from prioritized once when several have elements ready).

    A MergePrioritized has one out port, one or more input port with their priorities.

    '''Emits when''' one of the inputs has an element available, preferring a input based on its priority if multiple have elements available

    '''Backpressures when''' downstream backpressures

    '''Completes when''' all upstreams complete (eagerComplete=false) or one upstream completes (eagerComplete=true), default value is false

    '''Cancels when''' downstream cancels

    • Constructor Detail

      • MergePrioritized

        public MergePrioritized()
    • Method Detail

      • apply

        public static <T> GraphStage<UniformFanInShape<T,​T>> apply​(scala.collection.immutable.Seq<java.lang.Object> priorities,
                                                                         boolean eagerComplete)
        Create a new MergePrioritized with specified number of input ports.

        Parameters:
        priorities - priorities of the input ports
        eagerComplete - if true, the merge will complete as soon as one of its inputs completes.
        Returns:
        (undocumented)
      • apply$default$2

        public static <T> boolean apply$default$2()
      • priorities

        public scala.collection.immutable.Seq<java.lang.Object> priorities()
      • eagerComplete

        public boolean eagerComplete()
      • in

        public scala.collection.immutable.IndexedSeq<Inlet<T>> in()
      • shape

        public UniformFanInShape<T,​T> shape()
        Description copied from interface: Graph
        The shape of a graph is all that is externally visible: its inlets and outlets.
        Returns:
        (undocumented)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object