的ActorPath不ActorRef給人一種ActorPath因爲我一直在使用它發送消息給演員一些代碼testProbe
system.actorSelection("/user/myActor") ! "a message"
我需要確保這個消息確實發送。所以我需要在我的測試中創建一個生活在這個actor路徑中的testProbe(或類似的東西),以便它接收這些消息。
val probe = TestProbe()
val system.actorOf(probe.ref, "myActor") // ??? I want to give my probe name and path
我同意,雖然根據我的經驗,路徑作爲行動者之間的循環依賴關係的解決方案是有幫助的,而另一種情況是當您需要動態更改實現時(只需要殺死當前行爲者並在相同路徑下啓動新行爲者) –