I have a hierarchy like so:
/project/users/user-<userid>
There is just one "project", one "users", and many user-<userid> actors.
If I want to send a message from a different actor out side of
this hierarchy to one or more users, for example from /project/someactor,
it seems to me I have 3 basic ways of doing it (forgetting about EventBus,
which is a fourth):
1. I always have an ActorRef for /project. I can send it a message which it
will forward to /project/users who will grab the correct actor from its
children collection and forward the message to it.
2. I can construct an ActorSelection from /project/someactor and send
message to the ActorSelection directly.
3. I can store in /project/someactor in a HashMap or some other data
structure all the /project/users/user-<userid> ActorRef's, grab them from
the map when I need to send one a message and directly send a message to
the ActorRef
So, my questions are: what is the preferred way to communicate with an
actor in this case? Realizing that there might not be a preferred way -
what is a bad idea to do if any? What are the pros and cons that people see
in each way? Lastly, does anyone have a way I missed?
Thanks,
Chanan
--
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
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 akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.