Start removed but cluster is broken

This commit is contained in:
Viktor Klang 2011-09-08 11:02:17 +02:00
parent 24fb967988
commit bbb79d8e0d
144 changed files with 684 additions and 930 deletions

View file

@ -105,7 +105,7 @@ public class Pi {
LinkedList<ActorRef> workers = new LinkedList<ActorRef>();
for (int i = 0; i < nrOfWorkers; i++) {
ActorRef worker = actorOf(Worker.class, "worker").start();
ActorRef worker = actorOf(Worker.class, "worker");
workers.add(worker);
}
@ -172,7 +172,7 @@ public class Pi {
public UntypedActor create() {
return new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch);
}
}, "master").start();
}, "master");
// start the calculation
master.tell(new Calculate());

View file

@ -55,7 +55,7 @@ object Pi extends App {
var start: Long = _
// create the workers
val workers = Vector.fill(nrOfWorkers)(actorOf[Worker].start())
val workers = Vector.fill(nrOfWorkers)(actorOf[Worker])
// wrap them with a load-balancing router
val router = Routing.actorOf(
@ -105,7 +105,7 @@ object Pi extends App {
val latch = new CountDownLatch(1)
// create the master
val master = actorOf(new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch)).start()
val master = actorOf(new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch))
// start the calculation
master ! Calculate