Merge master into tame-globals branch

This commit is contained in:
Peter Vlugter 2011-10-13 13:41:44 +02:00
commit 317b8bc03b
60 changed files with 2079 additions and 1696 deletions

View file

@ -11,8 +11,10 @@ import static java.util.Arrays.asList;
import akka.AkkaApplication;
import akka.routing.RoutedProps;
import akka.routing.Routing;
import akka.routing.LocalConnectionManager;
import scala.Option;
import akka.actor.ActorRef;
import akka.actor.Actors;
import akka.actor.Channel;
import akka.actor.UntypedActor;
import akka.actor.UntypedActorFactory;
@ -24,7 +26,7 @@ import scala.collection.JavaConversions;
import java.util.LinkedList;
public class Pi {
private static final AkkaApplication app = new AkkaApplication();
public static void main(String[] args) throws Exception {
@ -105,7 +107,7 @@ public class Pi {
workers.add(worker);
}
router = app.routing().actorOf(RoutedProps.apply().withConnections(workers).withRoundRobinRouter(), "pi");
router = app.createActor(new RoutedProps().withRoundRobinRouter().withLocalConnections(workers), "pi");
}
@Override

View file

@ -9,7 +9,7 @@ import akka.event.EventHandler
import System.{ currentTimeMillis now }
import akka.routing.Routing.Broadcast
import akka.actor.{ Timeout, Channel, Actor, PoisonPill }
import akka.routing.{ RoutedProps, Routing }
import akka.routing._
import akka.AkkaApplication
object Pi extends App {
@ -56,7 +56,9 @@ object Pi extends App {
val workers = Vector.fill(nrOfWorkers)(app.createActor[Worker])
// wrap them with a load-balancing router
val router = app.routing.actorOf(RoutedProps().withConnections(workers).withRoundRobinRouter, "pi")
val router = app.createActor(RoutedProps(
routerFactory = () new RoundRobinRouter,
connectionManager = new LocalConnectionManager(workers)), "pi")
// phase 1, can accept a Calculate message
def scatter: Receive = {