Ilya
Ilya

Reputation: 71

play framework 2 promise status

In play 2.1 I can execute a block of code asynchronously with Akka like this:

Promise<Integer> promiseOfInt = Akka.future(
  new Callable<Integer>() {
    public Integer call() {
      return intensiveComputation();
    }
  }
);

How I can get status of this operation? For example: started, performed, completed, etc?

Upvotes: 1

Views: 267

Answers (1)

user908853
user908853

Reputation:

There are three callbacks you could use onSuccess, onFailure and onComplete.

See the "Callbacks" section here: http://doc.akka.io/docs/akka/2.1.0/scala/futures.html

Upvotes: 1

Related Questions