@@ -17,29 +17,29 @@ trait HostPicker {
1717 * @param hosts The hosts to pick from
1818 * @return A Future with an Option that contains the host if there was one.
1919 */
20- def apply (hosts : Set [String ])(implicit executionContext : ExecutionContext ): Future [Option [String ]]
20+ def apply (hosts : Set [String ], serviceName : Option [ String ] )(implicit executionContext : ExecutionContext ): Future [Option [String ]]
2121}
2222
2323object HeadHostPicker extends HostPicker {
24- def apply (hosts : Set [String ])(implicit executionContext : ExecutionContext ): Future [Option [String ]] = {
24+ def apply (hosts : Set [String ], serviceName : Option [ String ] = None )(implicit executionContext : ExecutionContext ): Future [Option [String ]] = {
2525 Future .successful(hosts.headOption)
2626 }
2727}
2828
2929object RandomHostPicker extends HostPicker {
3030 private [this ] val rand = new util.Random ()
31- def apply (hosts : Set [String ])(implicit executionContext : ExecutionContext ): Future [Option [String ]] = {
31+ def apply (hosts : Set [String ], serviceName : Option [ String ] = None )(implicit executionContext : ExecutionContext ): Future [Option [String ]] = {
3232 Future .successful(if (hosts.nonEmpty) Some (hosts.toList(rand.nextInt(hosts.size))) else None )
3333 }
3434}
3535
36- final object GlobalRoundRobinHostPicker extends RoundRobinHostPicker
36+ object GlobalRoundRobinHostPicker extends RoundRobinHostPicker
3737
3838sealed class RoundRobinHostPicker extends HostPicker {
3939 // Start at -1 so that the first call to incrementAndGet returns 0
4040 private [this ] val counter = new AtomicLong (- 1 )
4141
42- def apply (hosts : Set [String ])(implicit executionContext : ExecutionContext ): Future [Option [String ]] = {
42+ def apply (hosts : Set [String ], serviceName : Option [ String ] = None )(implicit executionContext : ExecutionContext ): Future [Option [String ]] = {
4343 Future .successful {
4444 val sortedHosts = hosts.toVector.sorted
4545
0 commit comments