Skip to content

Commit

Permalink
buildFactory()
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusae committed Jan 31, 2011
1 parent d5d59d6 commit 531d691
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -254,7 +254,7 @@ case class ClientBuilder[Req, Rep](
new WatermarkPool[Req, Rep](cachingPool, lowWatermark, highWatermark)
}

def build(): Service[Req, Rep] = {
def buildFactory(): ServiceFactory[Req, Rep] = {
if (!_cluster.isDefined)
throw new IncompleteSpecification("No hosts were specified")
if (!_protocol.isDefined)
Expand Down Expand Up @@ -294,8 +294,11 @@ case class ClientBuilder[Req, Rep](
factory
}

val factory = new LoadBalancedFactory(hostFactories, new LeastQueuedStrategy[Req, Rep])
var service: Service[Req, Rep] = new FactoryToService[Req, Rep](factory)
new LoadBalancedFactory(hostFactories, new LeastQueuedStrategy[Req, Rep])
}

def build(): Service[Req, Rep] = {
var service: Service[Req, Rep] = new FactoryToService[Req, Rep](buildFactory())

// We keep the retrying filter at the very bottom: this allows us
// to retry across multiple hosts, etc.
Expand Down

0 comments on commit 531d691

Please sign in to comment.