監督策略
我們遵循兩種監督策略來監督任何演員:
-
一對一策略
-
一對一策略
case object ResumeException extends Exception
case object StopException extends Exception
case object RestartException extends Exception
override val supervisorStrategy =
OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 second){
case ResumeException => Resume
case RestartException => Restart
case StopException => Stop
case _: Exception => Escalate
}