Hello all, I'm playing around with Akka in conjunction with the Play framework, working in Java. I have a reasonable understanding of how the actor system works in general, but I need some help wrapping my head around how to set up the system efficiently.
Let's take the Chat server example. Let's say my Play server has several chat rooms, each identified by an ID. Each chat room has a single actor which stores the chat history as state, and handles requests to post new messages, forwarding them in turn to all other listeners. It can also handle a request to get all previous chat history. My question is: How do you setup the actor hierarchy for this system to work efficiently? My first instinct is to create some sort of chat room supervisor actor which will store a map of chat room id's to child actor refs. This supervisor can now handle chat room failures, and requests to create or remove chat rooms. However, every request to every chat room now has to go through this supervisor, creating a bottleneck. Additionally, if I decide to make my chat room actors persistent, I'm not sure whether it is this supervisor's job to recreate those actors after a system restart. If not, how can the supervisor get its list of child actors back? I guess my root question is this: How do I setup a system which will have many stateful, persistent actors of the same type, all identified by a unique id such that: 1) Each actor is supervised by an actor which can handle issues with its lifecycle 2) Clients, such as HTTP requests from the Play framework, can efficiently communicate with these actors assuming they have that actor's ID Thanks for any help you can give me! -- >>>>>>>>>> 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.
