1

I am new to supervision in akka i want to know what supervision strategy is good when we get a ask timeout exception, what is more appropriate Restart or Resume here is the sample code

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)


}

please guide me ,Thanks

swaheed
  • 3,671
  • 10
  • 42
  • 103

0 Answers0