From the Akka documentation:
Actors are implemented by extending the
Actorbase trait and implementing thereceivemethod. Thereceivemethod should define a series of case statements (which has the typePartialFunction[Any, Unit]) that defines which messages your Actor can handle, using standard Scala pattern matching, along with the implementation of how the messages should be processed.
Code:
class MyActor extends Actor {
val log = Logging(context.system, this)
def receive = {
case "test" ⇒ log.info("received test")
case _ ⇒ log.info("received unknown message")
}
}
There is no input to receive, so what is being matched in the case statements?
Also, how does PartialFunction[Any, Unit] come into the picture here?