
Trupe: Implementing Supervisor
In my saga to implement an Actor System, I've covered so far the basic usage of Actor. Now, I'm going to cover supervisor. Supervisor In case you don't know, in Actor Model, a supervisor is a fundamental piece for fault tolerance. Supervisor will monitor children (actors) and react when one of them exhibits bad behaviour. A Supervisor is a special type of actor, focused only on monitoring and doing some action when children exhibit bad behaviour. Bad behaviour In Actor Model, bad behaviour is when an actor has an exception during message execution. When an actor throws an exception during message processing we have 2 main strategies. One For One: It'll restart only the failed child. All for One: It'll restart all children, if one failed. Now what to do when a restart doesn't work, and it's still failing? You can stop the child or scale it. Restart Another question is what restart means in Actor Model. In Actor Model and .NET it means killing/disposing that actor instance, the mailbox,
Continue reading on Dev.to
Opens in a new tab




