Package akka.actor

Examples of akka.actor.ActorRef.tell()


    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");
   
    Thread.sleep(500);
   
View Full Code Here


    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");
   
    Thread.sleep(500);
   
    master.tell(new Result(), null);
View Full Code Here

   
    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");
   
    Thread.sleep(500);
   
    master.tell(new Result(), null);
   
View Full Code Here

    master.tell("Dog is man's best friend");
    master.tell("Dog and Fox belong to the same family");
   
    Thread.sleep(500);
   
    master.tell(new Result(), null);
   
    Thread.sleep(500);
   
    _system.shutdown();
        System.out.println("Java done!");
View Full Code Here

        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

                            resource.encoding = metadata.extras.get("encoding");
                        }
                    }

                    if(resource.format.toLowerCase().equals("zip")) {
                        zipResourceFetcher.tell(resource, getSelf());
                    } else {
                        resourceFetcher.tell(resource, getSelf());
                    }
                }
View Full Code Here

            ActorRef metadataFetcher = getContext().actorFor("/user/ckanMetadataFetcher");

            for (String dataset : datasetList) {
                String url = ConfigFactory.load().getString("restopengov.ckan-rest-api") + dataset;
                metadataFetcher.tell(url, getSelf());
            }

            getContext().stop(getSelf());

        } else {
View Full Code Here

    }

    private void sendMessages(ActorSystem system) {
        ActorRef service = getService(system);
        for (int i = 0; i < 200; i++) {
            service.tell(new Bet("ready_player_one", i % 10 + 1, i % 100 + 1));
        }
        System.out.println("*** SENDING OK");
    }

    private void retrieveMessages(ActorSystem system) throws Exception {
View Full Code Here

        integrationMessage.getPayload());

    LOG.debug("Message Dispatcher sending trigger message to " + targetNodeActor);
   
    // send the integration message to the actor
    targetNodeActor.tell(triggerMessage, null);
   
    // send the meta data to the meta data actor (if it is not a start event, which can not collect meta data)
    if (integrationMessage.getProcessInstanceId() != null) {
      MetaDataMessage metaDataMessage = new MetaDataMessage(integrationMessage.getProcessId(), integrationMessage.getProcessInstanceId(), metaData);
     
View Full Code Here

   
    // FIXME: this is a bugfix, because messages are not properly sent without
    // prior calling of the actorSystem
    String ars = targetNode.path().toString();
    ActorRef ar = actorSystem.actorFor(ars);
    ar.tell(message, this.getSelf());
   
//    targetNode.tell(message, this.getSelf());
  }
 
  /**
 
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.