1

私は akka で監視を初めて使用します。ask タイムアウト例外が発生したときにどの監視戦略が適切かを知りたいのですが、より適切な再起動または再開はサンプル コードです。

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)


}

私を案内してください、ありがとう

4

0 に答える 0