learning-akka
learning-akka copied to clipboard
Chapter 2: Status.Failure usage
Hi, In the chapter 2, AkkademyDb class, we have two different syntaxes for the same pattern (sending a failure message to the sender)
case None => sender() ! Status.Failure(new KeyNotFoundException(key))
and
case o => Status.Failure(new ClassNotFoundException)
Why do we user sender() !
in the first example and not the second? Is there any difference? Does it matter?