标签: akka actor
有没有办法从AKKA的ActorRef获取演员姓名?
ActorRef
我指的是一个给演员的名字:
val myActorRef = context.actorOf(props, "MyActorName")
答案 0 :(得分:5)
可从路径访问该名称:
val name = myActorRef.path.name
同样,名称也在路径元素中:
val nameAgain = myActorRef.path.elements.last