Package akka.routing

Examples of akka.routing.RoundRobinRouter


        addressNodes);

    // update the workerRouter actor with the information on all workers
    workerRouterActor = getContext().system().actorOf(
        new Props(WorkerActor.class).withRouter(new RemoteRouterConfig(
            new RoundRobinRouter(workerAddress.length),
            workerAddress)));

  }
View Full Code Here


          addressNodes);

      workerRouterActor = getContext().system().actorOf(
          new Props(WorkerActor.class)
              .withRouter(new RemoteRouterConfig(
                  new RoundRobinRouter(workerAddress.length),
                  workerAddress)));
    } else
      workerRouterActor = null;

  }
View Full Code Here

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

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

   * @param args
   */
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("zeromqClientTest");
    system.actorOf(new Props(ClientActor.class)
        .withRouter(new RoundRobinRouter(3)), "client");
  }
View Full Code Here

   * @throws InterruptedException
   */
  public static void main(String[] args) throws InterruptedException {
    ActorSystem _system = ActorSystem.create("RoundRobinRouterExample");
    ActorRef roundRobinRouter = _system.actorOf(new Props(
        MsgEchoActor.class).withRouter(new RoundRobinRouter(5)),"myRoundRobinRouterActor");

    for (int i = 1; i <= 10; i++) {
      //sends messages in a round robin way to all the actors
      roundRobinRouter.tell(i);
      if (i == 5) {
View Full Code Here

    for(int i = 0; i < data.size() ; i++) {
      newValues.add(new Object());
    }
    routerActor = this.getContext().actorOf(
      new Props(ActorLevel2.class)
      .withRouter(new RoundRobinRouter(nrOfWorkers)), "roundRobinRouterActor");
  }
View Full Code Here

    this.data = data;
    this.nrOfWorkers = nrOfWorkers;
    this.newValues = ListUtils.fixedSizeList(data);
    routerActor = this.getContext().actorOf(
      new Props(ActorLevel2.class)
      .withRouter(new RoundRobinRouter(nrOfWorkers)), "roundRobinRouterActor");
  }
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.