On Wed, Feb 5, 2014 at 2:46 AM, Roger Alsing <[email protected]> wrote:
> Lets say we have the following senario > > * we have an unbounded number of entities > * each entity may only process one command at a time > * each entity only process a few messages occasionally and then idle for > an undefined amount of time > > Spawning an actor for each entity would force us to keep atleast one actor > per entity in memory all the time. which is expensive since the will mostly > be idle. > > What would be the most idiomatic Akka way to deal with this? > > Should we instead add an entity Id to each message, and have a custom > router that directs each message to a pool of actors and create an affinity > between the entity id and the pooled actor? > That's approximately the way my system works, and it generally works well. But I'd recommend that you also take a look at the new Akka Cluster Sharding stuff that's coming in 2.3 -- it's a nice general solution, and I'm likely to eventually migrate to it... -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> 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/groups/opt_out.
