On Mon, Mar 31, 2014 at 12:33 PM, Allan <[email protected]> wrote:

> Thanks for the quick response! :)
>
> I dont want to pay the cost of my aggregating actor waiting for all the
> async responses to come through though... I can think of two potential
> alternatives:
>  1) Store some cached, immutable copy of the relevant data from the other
> actors in my aggregator, so I already have the data I need
>

Sounds good!


>  2) Is it ever acceptable to have a reference to the other actors, and
> query (i.e. a read only operation) their state directly? Any updates would
> still be coming through the actor.
>

It's neither acceptable nor feasible: You don't have access to an actor,
only to its actor reference (`ActorRef`), so you can't access any members
directly.


> Or is there some other options that I'm missing?
>

Maybe routers for the other actors, so they can perform more work in
parallel?

Heiko


>
> Thanks,
> Allan.
>
>
>
> On Monday, March 31, 2014 5:46:02 PM UTC+11, Heiko Seeberger wrote:
>
>> You are right. Welcome to the asynchronous world ;-) Actually, unless you
>> watch those other actors (lifecycle monitoring aka death watch), you can't
>> even be sure they are still alive: They could have been stopped gracefully
>> for some reason or their remote node might have crashed.
>>
>> By the way: "waiting" for their responses should happen asynchronously,
>> i.e. your aggregating actor should simply handle their response messages.
>>
>> Heiko
>>
>>
>>
>> On Mon, Mar 31, 2014 at 5:58 AM, Allan <[email protected]> wrote:
>>
>>> Hey,
>>>
>>> I'm new to both the Actor Model, and Akka, so hopefully this isnt a
>>> silly question!
>>>
>>> Part of the system I'm trying to develop needs to perform a calculation.
>>> This calculation will be based off the details of a number of other actors.
>>> I'm assuming that my code / actor performing the calculation will need to
>>> query each of the other actors for their current state. This would
>>> presumably be done through sending each actor a message and waiting for
>>> it's response. But I don't have a guarantee that one of the actors I've
>>> just sent this message to isn't dealing with a bunch of other messages,
>>> meaning I could be waiting some time to get all the responses I need to do
>>> the calculation. Am I missing something?
>>>
>>> Thanks,
>>> Allan.
>>>
>>> --
>>> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Heiko Seeberger
>> Twitter: @hseeberger
>> Blog: blog.heikoseeberger.name
>>
>  --
> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Heiko Seeberger
Twitter: @hseeberger
Blog: blog.heikoseeberger.name

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to