Excellent answer Adam.
An interesting point to add here is that when using Scala there is no need
to call unhandled() explicitly, because Scala’s PartialFunction allows us
to inspect if the function is able to handle a message or not. If not (no case
x = matches the message), we call unhandled()
Thanks a lot. This is ver helpful.
I was curious to see if I can still see unhandled messages
On Mon, Apr 27, 2015 at 3:04 AM, Konrad Malawski kt...@typesafe.com wrote:
Excellent answer Adam.
An interesting point to add here is that when using Scala there is no need
to call unhandled()
Unhandled is mainly useful for troubleshooting. Akka won't check if you
actually did something with the message or not. It also doesn't force you to
call unhandled and probably (never tried this) does't prevent you from calling
unhandled multiple times. The documentation goes into detail
If an Actor does not handle a message is executes unhanded(message) as
if (message instanceof DiskMonitorMessage) {
// do something
} else {
unhandled(message);
}
- What happens now? where does this message go?
- Does it stays in Actor's mailbox? What if Actor never changes behavior
(no