Package akka.actor

Examples of akka.actor.ActorSelection


    if (message.equals("tick") && !nodes.isEmpty()) {
      // just pick any one
      List<Address> nodesList = new ArrayList<Address>(nodes);
      Address address = nodesList.get(ThreadLocalRandom.current().nextInt(
          nodesList.size()));
      ActorSelection service = getContext().actorSelection(address + servicePath);
      service.tell(new StatsJob("this is the text that will be analyzed"),
          getSelf());

    } else if (message instanceof StatsResult) {
      StatsResult result = (StatsResult) message;
      System.out.println(result);
View Full Code Here


  //#identify
  public class Follower extends AbstractActor {
    final Integer identifyId = 1;

    public Follower(){
      ActorSelection selection = context().actorSelection("/user/another");
      selection.tell(new Identify(identifyId), self());

      receive(ReceiveBuilder.
        match(ActorIdentity.class, id -> id.getRef() != null, id -> {
          ActorRef ref = id.getRef();
          context().watch(ref);
View Full Code Here

TOP

Related Classes of akka.actor.ActorSelection

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.