Package akka.routing

Examples of akka.routing.RoundRobinRouter


      this.nrOfMessages = nrOfMessages;
      this.nrOfElements = nrOfElements;
      this.listener = listener;

      workerRouter = this.getContext().actorOf(
          new Props(Worker.class).withRouter(new RoundRobinRouter(
              nrOfWorkers)), "workerRouter");
    }
View Full Code Here


    private RoundRobinRouterDataExtractor() {
    }

    public Map<String, String> extract(RouterConfig routerConfig) {
        RoundRobinRouter router = (RoundRobinRouter) routerConfig;
        return Collections.singletonMap("Num of instances", String.valueOf(router.nrOfInstances()));
    }
View Full Code Here

        super();
    }

    @Test
    public void testExtract() {
        RoundRobinRouter roundRobinRouter = new RoundRobinRouter(5);
        RoundRobinRouterDataExtractor extractor = RoundRobinRouterDataExtractor.INSTANCE;

        Map<String, String> extracted = extractor.extract(roundRobinRouter);
        Map<String, String> expected = Collections.singletonMap("Num of instances", String.valueOf(5));
View Full Code Here

    // create the list of reduce Actors
    reduceRouter = system.actorOf(new Props(new UntypedActorFactory() {
      public UntypedActor create() {
        return new ReduceActor(aggregateActor);
      }
    }).withRouter(new RoundRobinRouter(no_of_reduce_workers)));

    // create the list of map Actors
    mapRouter = system.actorOf(new Props(new UntypedActorFactory() {
      public UntypedActor create() {
        return new MapActor(reduceRouter);
      }
    }).withRouter(new RoundRobinRouter(no_of_map_workers)));

    // create the overall WCMapReduce Actor that acts as the remote actor
    // for clients
    wcMapReduceActor = system.actorOf(new Props(new UntypedActorFactory() {
      public UntypedActor create() {
View Full Code Here

    router = system.actorOf(new Props(new UntypedActorFactory() {
      public UntypedActor create() {
        return new WorkerActor(appManager);
      }
    }).withRouter(new RoundRobinRouter(no_of_workers)));
  }
View Full Code Here

    ActorSystem _system = ActorSystem.create("callingThread-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("CallingThreadDispatcher").withRouter(
            new RoundRobinRouter(2)));

    for (int i = 0; i < 5; i++) {
      actor.tell(i);
    }
View Full Code Here

    ActorSystem _system = ActorSystem.create("pinned-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("pinnedDispatcher").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
    }
View Full Code Here

    ActorSystem _system = ActorSystem.create("default-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("defaultDispatcher1").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
    }
View Full Code Here

    ActorSystem _system = ActorSystem.create("balancing-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("balancingDispatcher1").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
    }
View Full Code Here

    ActorSystem _system = ActorSystem.create("default-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("defaultDispatcher").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
    }
View Full Code Here

TOP

Related Classes of akka.routing.RoundRobinRouter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.