This commit is contained in:
Henrik Engstrom 2011-12-10 10:53:38 +01:00
parent 90b6833978
commit 11450ca4e0
5 changed files with 9 additions and 5 deletions

View file

@ -5,7 +5,6 @@
package akka.actor
import akka.testkit.AkkaSpec
import akka.util.duration._
import DeploymentConfig._
import akka.remote.RemoteAddress
import com.typesafe.config.ConfigFactory

View file

@ -530,7 +530,9 @@ class LocalActorRefProvider(
private def adaptFromDeploy(r: RouterConfig, p: ActorPath): RouterConfig = {
val lookupPath = p.elements.mkString("/", "/", "")
println("**** LOOKUP PATH : " + lookupPath)
val deploy = deployer.instance.lookupDeployment(lookupPath)
println("**** " + deploy)
r.adaptFromDeploy(deploy)
}

View file

@ -85,6 +85,9 @@ class RemoteActorRefProvider(
if (systemService) local.actorOf(system, props, supervisor, name, systemService)
else {
val path = supervisor.path / name
println("*** PATH : " + path.toString)
val newFuture = Promise[ActorRef](system.settings.ActorTimeout)(dispatcher)
actors.putIfAbsent(path.toString, newFuture) match { // we won the race -- create the actor and resolve the future

View file

@ -1,6 +1,6 @@
akka.actor.deployment {
/user/pi2 {
/user/master/pi {
router = round-robin
nr-of-instances = 4
nr-of-instances = 10
}
}
}

View file

@ -107,7 +107,7 @@ object Pi extends App {
// ===== Run it =====
// ==================
def calculate(nrOfWorkers: Int, nrOfElements: Int, nrOfMessages: Int) {
val system = ActorSystem("x", ConfigFactory.parseString("akka.actor.debug.lifecycle=true\nakka.loglevel=DEBUG"))
val system = ActorSystem()
// this latch is only plumbing to know when the calculation is completed
val latch = new CountDownLatch(1)