Class Interleave<T>

  • All Implemented Interfaces:

    public final class Interleave<T>
    extends GraphStage<UniformFanInShape<T,​T>>
    Interleave represents deterministic merge which takes N elements per input stream, in-order of inputs, emits them downstream and then cycles/"wraps-around" the inputs.

    '''Emits when''' element is available from current input (depending on phase)

    '''Backpressures when''' downstream backpressures

    '''Completes when''' all upstreams complete (eagerClose=false) or one upstream completes (eagerClose=true)

    '''Cancels when''' downstream cancels

    • Constructor Detail

      • Interleave

        public Interleave​(int inputPorts,
                          int segmentSize,
                          boolean eagerClose)
    • Method Detail

      • apply

        public static <T> Graph<UniformFanInShape<T,​T>,​NotUsed> apply​(int inputPorts,
                                                                                  int segmentSize,
                                                                                  boolean eagerClose)
        Create a new Interleave with the specified number of input ports and given size of elements to take from each input.

        inputPorts - number of input ports
        segmentSize - number of elements to send downstream before switching to next input port
        eagerClose - if true, interleave completes upstream if any of its upstream completes.
      • apply$default$3

        public static <T> boolean apply$default$3()
      • named

        public static Graph<S,​M> named​(java.lang.String name)
      • async

        public static Graph<S,​M> async()
      • async

        public static Graph<S,​M> async​(java.lang.String dispatcher)
      • async

        public static Graph<S,​M> async​(java.lang.String dispatcher,
                                             int inputBufferSize)
      • addAttributes

        public static Graph<S,​M> addAttributes​(Attributes attr)
      • initialAttributes

        protected static Attributes initialAttributes()
      • withAttributes

        public static final Graph<S,​M> withAttributes​(Attributes attr)
      • createLogicAndMaterializedValue

        public static final scala.Tuple2<GraphStageLogic,​NotUsed> createLogicAndMaterializedValue​(Attributes inheritedAttributes)
      • inputPorts

        public int inputPorts()
      • segmentSize

        public int segmentSize()
      • eagerClose

        public boolean eagerClose()
      • 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.
      • toString

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