Skip to content
This repository was archived by the owner on Aug 24, 2018. It is now read-only.

Commit 9c4fea8

Browse files
committed
Updates the service locator
1 parent 5bf7610 commit 9c4fea8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/scala_2.10/com/wordnik/swagger/client/ServiceLocator.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2323
object 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

2929
object 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

3838
sealed 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

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "0.3.1"
1+
version in ThisBuild := "0.3.2"

0 commit comments

Comments
 (0)