How to wait on a scala Future in java code -
i trying akka coding in java , have need blocking call. understand await.result can used block great can't figure out how awaitable await.result phone call requires.
here code able scala future. need help getting awaitable future.
final timeout t = new timeout(duration.create(5, timeunit.seconds)); final arraylist<future<object>> futures = new arraylist<future<object>>(); futures.add(ask(foo, "message", 5000)); final future<iterable<object>> aggregate = futures.sequence(futures, this.actorsystem.dispatcher());
the docs say:
trait future[+t] extends awaitable[t] the future is awaitable.
java scala akka scala-java-interop
No comments:
Post a Comment