Hi Roland,

Thanks for you thoughts on this.

In respect of the actor sending the messages, during the time it is 
iterating over it's children it will not be able to handle any new messages 
that arrive. Does the actor selection behave in the same way i.e. 
synchronously in the thread being used by actor to process the original 
message, or is the actor selection performed asynchronously?

Thanks

Nick

On Thursday, 29 January 2015 08:00:46 UTC, rkuhn wrote:
>
> Hi Nick,
>
> I never benchmarked this, but I would guess that the second one should be 
> a tad faster. Please share your findings!
>
> Thanks,
>
> Roland
>
> 28 jan 2015 kl. 21:37 skrev Nick Ebbitt <[email protected] <javascript:>
> >:
>
> I have a scenario where when an actor receives a specific message it must 
> forward the message to all of it's children that exist at that time.
>
> I think I have 2 options to solve this.
>
> getContext().actorSelection("*").forward(message, getContext());
>
> or
>
> getContext().getChildren().forEach(child -> child.forward(message, 
> getContext()));
>
> Without fully understanding the internal implementation of actor selection 
> it's hard to know which will perform better. I plan to perform some bench 
> marks with the kind of scale I am expecting to require but would appreciate 
> any insight to this that experienced users may have.
>
> Thanks
>
> I've also created a stack overflow question for this if anyone would like 
> to answer that: 
> http://stackoverflow.com/questions/28189059/is-forwarding-a-message-to-all-children-via-an-actor-selection-more-efficient-th
>
> -- 
> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> *Dr. Roland Kuhn*
> *Akka Tech Lead*
> Typesafe <http://typesafe.com/> – Reactive apps on the JVM.
> twitter: @rolandkuhn
> <http://twitter.com/#!/rolandkuhn>
>  
>

-- 
>>>>>>>>>>      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