Take the scenario where we have SimpleActor
and AnotherSimpleActor
actors. There's one child actor for SimpleActor
named SimplerrrActor
:
- SimpleActor:
/user/topLevelActor/simpleActor
- AnotherSimpleActor:
/user/topLevelActor/anotherSimpleActor
- SimplerrrActor:
/user/topLevelActor/simpleActor/simplerrrActor
In such cases, the user guardian is going to take care of topLevelActor
and topLevelActor
is going to supervise SimpleActor
and AnotherSimpleActor
. If something goes wrong in SimpleActor
and we want all the actors to resume/restart/stop, we can define an AllForOneStrategy
. If we want to perform such actions only on the failed SimpleActor
and its subsequent children, we can opt for OneForOneStrategy
.
These two are defined as case classes in Scala, which takes a few parameters in the form of maxNrOfRetries
, withinTimeRange
, and loggingEnabled
:
case class OneForOneStrategy( maxNrOfRetries: Int = -1, withinTimeRange: Duration =...