I have a an actor defined as so:
class nodeActor(ID: String) extends Actor
which contains a method, which is used to set up the actor before it
You're not supposed to call an actor's methods directly from another class. It breaks the whole design of the system, which is
ActorRef
obtained with the call to actorOf
or actorFor
!
, ?
) methodsIf you need to create a reference in ActorA
to another ActorB
you can:
ActorB
in the ActorA
's initialization code as shown in http://doc.akka.io/docs/akka/2.0.3/scala/actors.htmlActorB
's reference to the ActorA
as a specific message. Then ActorA
can store the reference within receive
implementationIf you need to call a method to satisfy an Interface/Trait constraint, have a look at Typed Actors