Hi Levi, since an actor cannot process the next message until the current has finished, there is no problem.
On Mon, Feb 10, 2014 at 7:03 PM, Levi Notik <[email protected]> wrote: > Consider the following example taken from the akka docs: > > > 1. def receive = { > 2. case "job" => worker ! "crunch" > 3. case Shutdown => > 4. worker ! PoisonPill > 5. context become shuttingDown > 6. } > 7. > 8. def shuttingDown: Receive = { > 9. case "job" => sender() ! "service unavailable, shutting down" > 10. case Terminated(`worker`) => > 11. context stop self > 12. } > > > I had assumed that the call to *context become* should always precede > sending the message to the other Actor because it's possible that Actor B > will respond before you've had a chance to switch to another Receive > behavior, in which case your Receive will not be defined for x. The above > example might be contrived, but one could imagine sending Actor B a message > where Actor B responds instantaneously. The docs seem to show sending > messages prior to the call to *context become*. Is this correct? > Shouldn't the order be reversed? > > > > -- > >>>>>>>>>> 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. > -- Cheers, √ *———————**Viktor Klang* *Chief Architect - **Typesafe <http://www.typesafe.com/>* Twitter: @viktorklang -- >>>>>>>>>> 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.
