Just reading through Akka samples, cant’t understand how is self.reply defined? As far as I can see, self reply is used inside receive blocks to reply to a message. But as far as reply is a method of self, then self is what?
PS: BTW, may you recommend a good quickstart article about Akka basics and remote actors with Scala – I’d appreciate if you could post a link as a comment here. Right now I am reading this.
selfis a reference to the ActorRef instance that contains that actor.When you create a new actor in Akka, the
actorOf[class]method returns an instance of ActorRef, not of your actual Actor implementation, the actor itself is hidden. This ActorRef is what you use to interact with the Actor. So theselfcan be used by the actor itself to get this reference.For example, if your actor wanted to send a message to itself, it would do