Say I have the following code:
override val supervisorStrategy: SupervisorStrategy = {
def defaultDecider: Decider = {
case _: ActorInitializationException => Stop
case _: ActorKilledException => Stop
case ce: ConnectException => {
log.info("ConnectException found. Restarting actor....")
Restart
}
case _: Exception => Stop
}
OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = Duration.Inf)(defaultDecider)
}
val actor1Dispatcher = context.actorOf(Props[actor1Dispatcher], name = "actor1Dispatcher")
val actor2Dispatcher = context.actorOf(Props[actor2Dispatcher], name = "actor2Dispatcher")
val actor3Dispatcher = context.actorOf(Props[actor3Dispatcher], name = "actor3Dispatcher")
And say that I only want to restart an actor on a ConnectionException if the actor is a actor1Dispatcher, else, I just want to run as default. Is this possible? I haven't found anything to run the dispatch on only one type of child actor.