How do I create an Akka2 actor for kids when all I have is an ActorRef for the parent?

In need to create an Akka2 actor (derived from UntypedActor) as a child of an existing actor (also derived from UntypedActor). The only reference I have to the parent actor is an ActorRef. Is there any way to do this? I'd like to call the parent's UntypedActorContext.actorOf() method, but don't know how to get a reference to it using the Akka API. Is there a better way of accomplishing my goal?

Can you change the code of the parent actor? You could for example add a handler for a message of type Props in your parent and create the child there. It is not possible to get the context outside of the actor class.

我来评几句
登录后评论

已发表评论数()

相关站点

+订阅
热门文章