Package org.apache.pekko.stream.javadsl
Class Balance$
java.lang.Object
org.apache.pekko.stream.javadsl.Balance$
Fan-out the stream to several streams. Each upstream element is emitted to the first available downstream consumer.
 It will not shutdown until the subscriptions for at least
 two downstream subscribers have been established.
 
'''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
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<T> Graph<UniformFanOutShape<T,T>, NotUsed> create(int outputCount) Create a newBalanceoperator with the specified input type, bothwaitForAllDownstreamsandeagerCancelarefalse.<T> Graph<UniformFanOutShape<T,T>, NotUsed> create(int outputCount, boolean waitForAllDownstreams) Create a newBalanceoperator with the specified input type,eagerCancelisfalse.<T> Graph<UniformFanOutShape<T,T>, NotUsed> create(int outputCount, boolean waitForAllDownstreams, boolean eagerCancel) Create a newBalanceoperator with the specified input type.<T> Graph<UniformFanOutShape<T,T>, NotUsed> Create a newBalanceoperator with the specified input type, bothwaitForAllDownstreamsandeagerCancelarefalse.<T> Graph<UniformFanOutShape<T,T>, NotUsed> Create a newBalanceoperator with the specified input type,eagerCancelisfalse.<T> Graph<UniformFanOutShape<T,T>, NotUsed> Create a newBalanceoperator with the specified input type.
- 
Field Details- 
MODULE$Static reference to the singleton instance of this Scala object.
 
- 
- 
Constructor Details- 
Balance$public Balance$()
 
- 
- 
Method Details- 
createpublic <T> Graph<UniformFanOutShape<T,T>, createNotUsed> (int outputCount, boolean waitForAllDownstreams) Create a newBalanceoperator with the specified input type,eagerCancelisfalse.- Parameters:
- outputCount- number of output ports
- waitForAllDownstreams- if- trueit will not start emitting elements to downstream outputs until all of them have requested at least one element
 
- 
createpublic <T> Graph<UniformFanOutShape<T,T>, createNotUsed> (int outputCount, boolean waitForAllDownstreams, boolean eagerCancel) Create a newBalanceoperator with the specified input type.- Parameters:
- outputCount- number of output ports
- waitForAllDownstreams- if- trueit will not start emitting elements to downstream outputs until all of them have requested at least one element
- eagerCancel- if true, balance cancels upstream if any of its downstreams cancel, if false, when all have cancelled.
 
- 
createCreate a newBalanceoperator with the specified input type, bothwaitForAllDownstreamsandeagerCancelarefalse.- Parameters:
- outputCount- number of output ports
 
- 
createCreate a newBalanceoperator with the specified input type, bothwaitForAllDownstreamsandeagerCancelarefalse.- Parameters:
- clazz- a type hint for this method
- outputCount- number of output ports
 
- 
createpublic <T> Graph<UniformFanOutShape<T,T>, createNotUsed> (Class<T> clazz, int outputCount, boolean waitForAllDownstreams) Create a newBalanceoperator with the specified input type,eagerCancelisfalse.- Parameters:
- clazz- a type hint for this method
- outputCount- number of output ports
- waitForAllDownstreams- if- trueit will not start emitting elements to downstream outputs until all of them have requested at least one element
 
- 
createpublic <T> Graph<UniformFanOutShape<T,T>, createNotUsed> (Class<T> clazz, int outputCount, boolean waitForAllDownstreams, boolean eagerCancel) Create a newBalanceoperator with the specified input type.- Parameters:
- clazz- a type hint for this method
- outputCount- number of output ports
- waitForAllDownstreams- if- trueit will not start emitting elements to downstream outputs until all of them have requested at least one element
- eagerCancel- if true, balance cancels upstream if any of its downstreams cancel, if false, when all have cancelled.
 
 
-