1) resume supervisor strategy

2) Make receive final in the general EndpointActor and impl the
try-catch-reply there, and delegate the actual message processing to an
abstract method. That breaks down if using become, but otherwise it's fine.

/Patrik
lör 1 apr. 2017 kl. 21:17 skrev kraythe <[email protected]>:

> There are two situations where i need to deal with exceptions outside of
> the normal "Let it crash" paradigm.
>
> First is an actor that can't crash. I have some actors that cache a ton of
> information and their startup can take quite a while. If some method throws
> in the actor unless the exception is absolutely destructive I dont want to
> restart the actor ever. Now I can put a try-catch in the recieve method but
> that seems to be a little heavyweight, or put a try-catch in the sub
> methods but that will require me to wrap every message handler in
> try-catch. So I am wondering what people's opinion are on the best
> practice.
>
> The second situation is an endpoint actor that serves an HTTP request. If
> this actor throws I want to return a standard error message to the user,
> not just leave them hanging, this is complicated by the fact that I have a
> general EndpointActor that implements a ton of boilerplate functionality
> and many endpoints extend this, so if I put a try-catch in the endpoint
> actor's receive loop it wouldnt matter if the subclass overrides that loop.
> Of course I could require the user to do the same try-catch but then that
> seems boilerplate so I am not comfortable with that either.
>
> Any thoughts on best practices?
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to