Package akka.routing

Examples of akka.routing.RandomRouter


    int lowerBound = 2;
    int upperBound = 15;
    DefaultResizer resizer = new DefaultResizer(lowerBound, upperBound);

    ActorRef randomRouter = _system.actorOf(new Props(MsgEchoActor.class)
        .withRouter(new RandomRouter(resizer)));

    for (int i = 1; i <= 10; i++) {
      // sends randomly to actors
      randomRouter.tell(i);
    }
View Full Code Here


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

    for (int i = 1; i <= 10; i++) {
      //sends randomly to actors
      randomRouter.tell(i);
    }
View Full Code Here

TOP

Related Classes of akka.routing.RandomRouter

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.