Package akka.util

Examples of akka.util.Duration


        Result result = (Result) message;
        pi += result.getValue();
        nrOfResults += 1;
        if (nrOfResults == nrOfMessages) {
          // Send the result to the listener
          Duration duration = Duration.create(
              System.currentTimeMillis() - start,
              TimeUnit.MILLISECONDS);
          listener.tell(new PiApproximation(pi, duration), getSelf());
          // Stops this actor and all its supervised children
          getContext().stop(getSelf());
View Full Code Here


  public void testSupervisorStrategy1() throws Exception {

    ActorRef supervisorActorRef1 = _system.actorOf(new Props(
        SupervisorActor.class), "supervisor1");

    Duration timeout = Duration.parse("5 second");
    // register the BoomActor with the Supervisor
    final ActorRef child = (ActorRef) Await.result(
        ask(supervisorActorRef1, new Props(BoomActor.class), 5000),
        timeout);
View Full Code Here

        this.name = name;
    }

    @Override public TransactionFactory transactionFactory() {
        return new TransactionFactoryBuilder()
            .setTimeout(new Duration(3, TimeUnit.SECONDS))
            .build();
    }
View Full Code Here

TOP

Related Classes of akka.util.Duration

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.