First of all, postStop()
is called from preRestart()
default implementation of the same actor (see here), while Terminated
message is sent to the parent only when the actor is really stopped, not when it is just restarted. Hence in default setup postStop()
may be called more times than Terminated
message is sent.
But the main idea is that post*
and pre*
hooks are needed to cleanup the actor's own state, and Terminated
message (the whole watch system, in fact) is intended to coordinate multiple actors behavior and state. Their purpose is different, and while you can send custom Terminated
-like messages from postStop()
hook, you really shouldn't.