Class Balance<T>

  • All Implemented Interfaces:

    public final class Balance<T>
    extends GraphStage<UniformFanOutShape<T,​T>>
    Fan-out the stream to several streams. Each upstream element is emitted to the first available downstream consumer. It will not shut down until the subscriptions for at least two downstream subscribers have been established.

    A Balance has one in port and 2 or more out ports.

    '''Emits when''' any of the outputs stops backpressuring; emits the element to the first available output

    '''Backpressures when''' all of the outputs backpressure

    '''Completes when''' upstream completes

    '''Cancels when''' If eagerCancel is enabled: when any downstream cancels; otherwise: when all downstreams cancel

    • Constructor Detail

      • Balance

        public Balance​(int outputPorts,
                       boolean waitForAllDownstreams,
                       boolean eagerCancel)
      • Balance

        public Balance​(int outputPorts,
                       boolean waitForAllDownstreams)
        Use the constructor which also specifies the `eagerCancel` parameter. Since 2.5.12.