Skip to content

Instantly share code, notes, and snippets.

@astubbs
Created April 10, 2012 21:21
Show Gist options
  • Save astubbs/2354674 to your computer and use it in GitHub Desktop.
Save astubbs/2354674 to your computer and use it in GitHub Desktop.
Timeout timeout = new Timeout(Duration.parse("20 seconds"));
Future<Object> future = Patterns.ask(myActor, new ClientMessage(null), timeout);
Promise<Object> sdf = Akka.asPromise(future);
Promise<Result> r2 = sdf.map(new Function<Object, Result>() {
@Override
public Result apply(Object a) throws Throwable {
val wsrm = (MyMessage)a;
return ok((wsrm).val); // String value from message object
}
});
Result test2 = async(r2);
return test2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment