Hello,
I am new to Akka. I am a bit confused with parallel Akka calls from an
Akka actor. What I was trying to do is to make parallel-concurrent calls to
two other actors using ask and awaiting for future to get resolved.
public class Actor1 extends UntypedActor {
public void onReceive(Object message) throws Throwable {
Future<Object> searchFuture1 = ask(actor2, requestMessage,
FUTURE_ACTOR_TIMEOUT);
ResponseMessage responseMessage1 = (ResponseMessage)
Await.result(searchFuture1, Duration.create(FUTURE_ACTOR_TIMEOUT,
TimeUnit.MILLISECONDS));
Future<Object> searchFuture2 = ask(actor3, requestMessage,
FUTURE_ACTOR_TIMEOUT);
ResponseMessage responseMessage2 = (ResponseMessage)
Await.result(searchFuture2, Duration.create(FUTURE_ACTOR_TIMEOUT,
TimeUnit.MILLISECONDS));
//logic to merge both the response messages
}
}
It looks sequential while making the calls to the separate actors. I want
the calls(ask) to the actors in parallel. How can I achieve it.?Please help
me to understand.
Thanks in Advance.
Tanmoy
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.