Skip to content

Instantly share code, notes, and snippets.

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