Is there a standard pattern to deal with exceptions within actors in Akka.NET?
I saw some patterns to create supervisors, but it seems the SupervisorStrategy
is a way to deal with things that cannot be resolved by the actor.
I have an actor that receives lots of data and needs to store it in an external server. The external database may be unreachable. If it is, the server may be restarting or the network may be down. I don't need to restart the actor or anything, I just want to notify the sender with some information about what is happening, so he can persist the message on disk and reschedule for later.
The sender is not a parent of this actor connecting to the database. Should I create a supervisor just to handle this as well? Or should I encapsulate my receive handlers in try/catch blocks and just use Tell
to notify the senders a with a custom response as if it was a normal message?
I know there is a Failure
class, but I'm not sure if I'm suppose to use that for this situation.