我有這個不是重播的消息:阿卡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
的任何原因?