Scala AskTimeOutException的监管策略应该是什么
我是akka监管的新手,我想知道当我们遇到ask超时异常时,什么样的监管策略是好的,什么是更合适的重启或恢复 下面是示例代码Scala AskTimeOutException的监管策略应该是什么,scala,akka,akka-supervision,Scala,Akka,Akka Supervision,我是akka监管的新手,我想知道当我们遇到ask超时异常时,什么样的监管策略是好的,什么是更合适的重启或恢复 下面是示例代码 class ActorA extends Actor{ override val supervisorStrategy = OneForOneStrategy( maxNrOfRetries = 10, withinTimeRange = 10 seconds) { case _:AskTim
class ActorA extends Actor{
override val supervisorStrategy = OneForOneStrategy(
maxNrOfRetries = 10, withinTimeRange = 10 seconds) {
case _:AskTimeoutException => ??? (Resume/Restart)
case _:Exception => Restart
}
val actorB =context.actorof ...//actor creation code
implicit val timeout = Timeout(interval , SECONDS)
val future = ask(actorB, MessageB).mapTo[Boolean] //what if actorB does not reply withing the time and AskTimeoutException is thrown the what should be the supervision strategy
var response = Await.result(future, timeout.duration)
}
请引导我,谢谢