public static class WeightedLoadbalanceStrategy.Builder extends Object
WeightedLoadbalanceStrategy.| Modifier and Type | Method and Description |
|---|---|
WeightedLoadbalanceStrategy |
build() |
WeightedLoadbalanceStrategy.Builder |
maxPairSelectionAttempts(int numberOfAttempts)
How many times to try to randomly select a pair of RSocket connections with non-zero
availability.
|
WeightedLoadbalanceStrategy.Builder |
weightedStatsResolver(Function<RSocket,WeightedStats> resolver)
Configure how the created
WeightedLoadbalanceStrategy should find the stats for a
given RSocket. |
public WeightedLoadbalanceStrategy.Builder maxPairSelectionAttempts(int numberOfAttempts)
By default this is set to 5.
numberOfAttempts - the iteration countpublic WeightedLoadbalanceStrategy.Builder weightedStatsResolver(Function<RSocket,WeightedStats> resolver)
WeightedLoadbalanceStrategy should find the stats for a
given RSocket.
By default WeightedLoadbalanceStrategy installs a RequestInterceptor when
ClientLoadbalanceStrategy.initialize(RSocketConnector) is called in order to keep
track of stats.
resolver - the function to find the stats for an RSocketpublic WeightedLoadbalanceStrategy build()