Reputation: 1204
I use Akka framework with Java API, so then I try to understand source code of framework - I can't, because it's written in Scala, unfortunately I don't know this language.
So, what is the difference between getting ActorRef pointing to self with self()
and getSelf()
method?
UPDATE: And what about context() and getContext()? I've noticed they return objects of different types within actor, extended from UntypedActor.
Upvotes: 1
Views: 1785
Reputation: 1863
self()
is the idiomatic scala API and getSelf()
is the idiomatic Java API. They return the same value, but getSelf()
is only accessible from subclasses of UntypedActor
which is the class to be extended from Java to implement actors.
Upvotes: 4