On Sun, Apr 27, 2014 at 10:06 PM, 杨博 <[email protected]> wrote: > I guess I won't resolve this problem at any time. Yes, I can resolve it by > dispatching different message to different Futures in one actor. But IMHO, > it's not the best design model with Akka. I suggest you forward different > messages to different actors, and use Future in those actors. >
That's plausible for some use cases, but honestly -- it doesn't work for most of the real code I deal with. The point of Actors is largely to provide safe asynchronous operations for some state living in memory, and most of the time a given chunk of state needs to expose a number of different operations. Indeed, I can't think of any of my Actors that expose *fewer* than three entry points. Moreover, those operations should typically expect to be called in an interleaved fashion -- indeed, even an Actor that only accepts a single entry point will get called by various callers at fairly random times. (Which is why become() is tricky to use properly at the best of times -- so far, I don't think I've ever actually used it outside of initialization.) So while I appreciate the idea here, I'm not sure I'd ever be likely to use it in real code... -- >>>>>>>>>> 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.
