我有这个不是重播的消息:阿卡unstashAll()
val receive = beforeLoadReceive // my default receive
override def preStart(): Unit = {
doSomeLoadFromDB()
unstashAll()
context.become(connectedReceive)
println("I also get to here..."
}
def connectedReceive: Receive = {
case GetData =>
println("for some reason i'm not getting to here after unstashAll why?")
sender() ! "this is your data"
}
def beforeLoadReceive: Receive = {
case GetData =>
println(s"I get to here so it's stashed")
stash()
}
所以我使用的stash()
我看到,我得到一个消息,有这样的藏,我也看到事后说unstashAll()
的调用,但我不明白:connectedReceive
的任何原因?