Package akka.actor

Examples of akka.actor.ActorSystem.actorOf()


   */
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("zeromqTest");
    system.actorOf(new Props(PushActor.class), "push");
    system.actorOf(new Props(PullActor1.class), "pull1");
    system.actorOf(new Props(PullActor2.class), "pull2");
  }

}
View Full Code Here


   * @param args
   * @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);
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("zeromqTest");
    system.actorOf(new Props(WorkerTaskA.class), "workerA");
    system.actorOf(new Props(WorkerTaskB.class), "workerB");
    system.actorOf(new Props(PublisherActor.class), "publisher");
  }

}
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("zeromqTest");
    system.actorOf(new Props(WorkerTaskA.class), "workerA");
    system.actorOf(new Props(WorkerTaskB.class), "workerB");
    system.actorOf(new Props(PublisherActor.class), "publisher");
  }

}
View Full Code Here

   */
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("zeromqTest");
    system.actorOf(new Props(WorkerTaskA.class), "workerA");
    system.actorOf(new Props(WorkerTaskB.class), "workerB");
    system.actorOf(new Props(PublisherActor.class), "publisher");
  }

}
View Full Code Here

  public static void main(String[] args) throws Exception {

    ActorSystem _system = ActorSystem.create("MapReduceApp");
   
    ActorRef master = _system.actorOf(new Props(MasterActor.class),"master");
   
    master.tell("The quick brown fox tried to jump over the lazy dog and fell on the dog");
    master.tell("Dog is man's best friend");
    master.tell("Dog and Fox belong to the same family");
   
View Full Code Here

        historicalEvent.creationDate = new Date();
        historicalEvent.category = category;
        historicalEvent.message = message;

        ActorSystem actorSystem = Akka.system();
        ActorRef actor = actorSystem.actorOf(new Props(HistoricalEventActor.class));
        actor.tell(historicalEvent);
    }
}
View Full Code Here

    }

    public void scheduleJobs()
    {
        ActorSystem actorSystem = Akka.system();
        ActorRef feedCreationActor = actorSystem.actorOf(new Props(FeedCreationActor.class));
        actorSystem.scheduler().schedule(Duration.create(0, TimeUnit.MILLISECONDS),
                                           Duration.create(1, TimeUnit.HOURS),
                                           feedCreationActor,
                                           "generate");
    }
View Full Code Here

import com.typesafe.config.ConfigFactory;

public class BettingProcessorApplication {
    public static void main(String[] args) {
        ActorSystem system = ActorSystem.create("BettingProcessorActorSystem", ConfigFactory.load());
        ActorRef bettingProcessor = system.actorOf(new Props(BettingProcessor.class), "bettingProcessor");
    }
}
View Full Code Here

import com.typesafe.config.ConfigFactory;

public class BettingServiceApplication {
    public static void main(String[] args) {
        ActorSystem system = ActorSystem.create("BettingServiceActorSystem", ConfigFactory.load());
        system.actorOf(new Props(BettingService.class), "bettingService");
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.