I have a non-actor-based piece of code which delegates some operations to an akka actor and I would like to wait this actor response indefinitely, I mean, until this actor returns a response whatever time it takes. The problem is I have not idea how to wait indefinitely in a Future with Pattern.ask and Await.result methods.
I would something like this:
Timeout timeout = new Timeout(Duration.inf());
Future<Object> future = Patterns.ask(actor, msg, timeout);
String result = (String) Await.result(future, timeout.duration());
but this does not work because Timeout does not accept a Duration object as constructor parameter, it only accepts FiniteDuration objetcs...
Any idea?
Cheers