If I define the supervisor strategy for an actor in Scala, how can I use both the OneForOneStrategy and the AllForOneStrategy? Is there a simple way to combine them or do I have to define a custom SupervisorStrategy?
Here is an example:
class MyActor extends Actor {
override val supervisorStrategy = OneForOneStrategy() {
case _: NullPointerException => Restart
case _: FileNotFoundException => Restart // here I want to restart all children
case _: Exception => Escalate
}
}
If I have to write my own supervisor strategy, how can I do this? I found no example for that.