What you are looking for is exactly what Akka routers provide. http://doc.akka.io/docs/akka/2.3.2/scala/routing.html#How_Routing_is_Designed_within_Akka
However, it can be good to know that a single actor can process a few million messages per second. /Patrik > 26 apr 2014 kl. 02:36 skrev David Hoyt <[email protected]>: > > Let's say I have a router actor whose sole purpose is really to supervise > routees but otherwise should be out of the picture. If I want to send a > message for processing by a routee, I would first send it to the router > actor, correct? If I do that, does it effectively bottleneck all messages to > routees since it's being placed in the router's mailbox before it's > distributed amongst routees? > > It almost seems that what I'm actually looking for is a "ghost router" so to > speak -- where all messages sent to it are really placed on a shared mailbox > amongst all routees but the router is still responsible for supervision. The > router and routees will always be in the same process. > > Here's a use case (and I'd appreciate any/all suggestions on alternatives): a > pool of actors responsible for persisting data into backend storage. So if I > want to save something to persistent storage I would send it to my storage > router first which is abstracting the ultimate storage destination. It would > then select a routee to actually do the work. If a routee dies for whatever > reason, the storage router can create a new one and ensure a proper pool size. > > Here's my concern: if I have lots of other actors trying to send messages to > my single router, then the router becomes a bottleneck if it processes > messages one-by-one. I like the idea of having my router supervise members of > the pool, but I don't want all messages to go through it before fanning out > to routees. Hope that makes sense. Can you think of an alternative way of > doing it? > > Thanks so much! > > -- > >>>>>>>>>> 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. -- >>>>>>>>>> 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.
