Renaming createActor to actorOf
This commit is contained in:
parent
3f258f8b63
commit
474787a81d
68 changed files with 343 additions and 343 deletions
|
|
@ -110,11 +110,11 @@ public class Pi {
|
|||
|
||||
LinkedList<ActorRef> workers = new LinkedList<ActorRef>();
|
||||
for (int i = 0; i < nrOfWorkers; i++) {
|
||||
ActorRef worker = app.createActor(Worker.class);
|
||||
ActorRef worker = app.actorOf(Worker.class);
|
||||
workers.add(worker);
|
||||
}
|
||||
|
||||
router = app.createActor(new RoutedProps().withRoundRobinRouter().withLocalConnections(workers), "pi");
|
||||
router = app.actorOf(new RoutedProps().withRoundRobinRouter().withLocalConnections(workers), "pi");
|
||||
}
|
||||
|
||||
// message handler
|
||||
|
|
@ -168,7 +168,7 @@ public class Pi {
|
|||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
|
||||
// create the master
|
||||
ActorRef master = app.createActor(new UntypedActorFactory() {
|
||||
ActorRef master = app.actorOf(new UntypedActorFactory() {
|
||||
public UntypedActor create() {
|
||||
return new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ object Pi extends App {
|
|||
var start: Long = _
|
||||
|
||||
// create the workers
|
||||
val workers = Vector.fill(nrOfWorkers)(app.createActor[Worker])
|
||||
val workers = Vector.fill(nrOfWorkers)(app.actorOf[Worker])
|
||||
|
||||
// wrap them with a load-balancing router
|
||||
val router = app.createActor(RoutedProps().withRoundRobinRouter.withLocalConnections(workers), "pi")
|
||||
val router = app.actorOf(RoutedProps().withRoundRobinRouter.withLocalConnections(workers), "pi")
|
||||
|
||||
// message handler
|
||||
def receive = {
|
||||
|
|
@ -104,7 +104,7 @@ object Pi extends App {
|
|||
val latch = new CountDownLatch(1)
|
||||
|
||||
// create the master
|
||||
val master = app.createActor(new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch))
|
||||
val master = app.actorOf(new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch))
|
||||
|
||||
// start the calculation
|
||||
master ! Calculate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue