What you're asking falls into the definition of a Message Filter pattern - http://www.eaipatterns.com/Filter.html If you really don't care then its essentially the same as sending to /dev/null. But as Ryan pointed out during the development you may want to turn the DEBUG option on, just so you can track what other messages are being sent to your Actor, since technically the more important question would be; Why you are receiving unintended messages? I mean if this Actor is intended to behave as a Filter, then fine, but personally I think I would probably opt out for a dedicated Filter/Router Actor, thus ensuring that my process Actors only deal with Messages they were designed for. In any event its more of an architectural question.
Oleg On Fri, Jan 24, 2014 at 4:48 PM, Ryan Tanner <[email protected]> wrote: > From the docs: > > If the current actor behavior does not match a received message, unhandled is > called, which by default publishes an akka.actor.UnhandledMessage(message, > sender, recipient) on the actor system’s event stream (set configuration > item akka.actor.debug.unhandled to on to have them converted into actual > Debug messages). > > > On Friday, January 24, 2014 3:39:24 PM UTC-6, [email protected]: >> >> Hi >> >> While implementing actors, is it necessary to implement a "catch all" >> case in the receive method. Are there any guidelines around these? For eg: >> >> override def receive = { >> case x: Type1 => ... >> case y: Type2 => ... >> } >> >> Should we have a "case _: " or something similar to handle any other type >> that this actor doesn't care about? >> >> Thanks for your inputs. >> >> >> - Ranga >> > -- > >>>>>>>>>> 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. > -- >>>>>>>>>> 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.
