Package akka.routing

Examples of akka.routing.SmallestMailboxRouter


   * @param args
   */
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("SmallestMailBoxRouterExample");
    ActorRef smallestMailBoxRouter = _system.actorOf(new Props(MsgEchoActor.class)
        .withRouter(new SmallestMailboxRouter(5)),"mySmallestMailBoxRouterActor");

    for (int i = 1; i <= 10; i++) {
      //works like roundrobin but tries to rebalance the load based on
      //size of actor's mailbox
      smallestMailBoxRouter.tell(i);
View Full Code Here


   */
  public CoreActors(ActorSystem actorSystem, String metaDataActorName, int instances, String processInstanceCleansingActorName) {
    this.actorSystem = actorSystem;
    this.metaDataActor = this.actorSystem.actorOf(
        new Props(MetaDataService.class).withRouter(
            new SmallestMailboxRouter(instances))
            .withDispatcher("file-mailbox-dispatcher"),
            metaDataActorName);
    this.processInstanceCleansingActor = this.actorSystem.actorOf(
        new Props(ProcessInstanceCleansingService.class).withRouter(
            new SmallestMailboxRouter(instances))
            .withDispatcher("file-mailbox-dispatcher"),
            processInstanceCleansingActorName);
  }
View Full Code Here

TOP

Related Classes of akka.routing.SmallestMailboxRouter

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.