Yeah you are right. Actually that's what is happening. I may not have
explained it right.
The Actor system has a hierarchy of master and multiple workers. The master
is responsible for correlating the stream of result from the workers,
correlating, aggregating and returning a single response to the non-actor
instance.
The non-actor instance here is using ask to get a single response. Where I
am coming for is, when i use Junit and invoke multiple requests to the
non-actor instance. I am invoking the actor system individually and
expecting multiple ask returns. It is something like this.
for(i=0;i<10;i++) {
non_actor_instance.request();
}
function request() {
ask(supervisor, msg);
}
On Wednesday, 27 July 2016 21:53:01 UTC+5:30, Justin du coeur wrote:
>
> Hmm -- I think you may be misunderstanding ask. Ask sends *one* message,
> and gets *one* response. It sounds like you're trying to use it to get a
> stream of responses, and it just doesn't do that.
>
> For that matter, ask gives you back a Future, and Future only returns a
> single response. It's not designed to represent a stream.
>
> To get a stream of responses, which sounds like what you're looking for,
> you're going to have to build something more sophisticated, I'm afraid. My
> usual recommendation would be to add another Actor in the workflow, which
> receives the initial ask, sends out the request, collates the results from
> the workers and returns them as a *single* response to the non-Actor code...
>
> On Wed, Jul 27, 2016 at 5:17 AM, Love Hasija <[email protected]
> <javascript:>> wrote:
>
>> Hi,
>>
>> I am observing a strange behavior but I am sure, I did something wrong.
>>
>> I have a service class providing a DB Wrapper, which has async methods
>> for providing services. Internally there is an actor workflow. but the
>> service class is not part of actor system and simply invokes ask to the
>> actor system.
>>
>> Here's an example.
>>
>> Async Service => Supervisor => Workers.
>> (ask) => (results from the supervisor).
>>
>> When I am testing the same using Junit by invoking multiple parallel
>> requests., what I am observing is that the supervisors and workers behave
>> properly, but only the first response comes back to ask actor, others are
>> lost to the dead letter queue.
>>
>> While debugging, I saw all the ask actor references are same:
>> Actor[akka://MyActorSystem/temp/$a]
>>
>> Is it something, I am doing wrong.
>>
>> --
>> >>>>>>>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
>>>>>>>>>> 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.