Created
April 10, 2012 21:21
-
-
Save astubbs/2354674 to your computer and use it in GitHub Desktop.
http://letitcrash.com/post/17888436664/a-sample-application-showcasing-play-mini-and-akka Java example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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