best way to design user-defined hook system (handling async errors)
Marc Lehmann
schmorp at schmorp.de
Tue Jan 29 15:57:30 CET 2013
On Sun, Jan 27, 2013 at 01:45:58PM -0600, Lee Aylward <laylward at gmail.com> wrote:
> Yes, this is my main concern. If the callback dies (as in
> https://gist.github.com/4645022) before calling the passed in function,
> an HTTP request will never complete. I see your point about wrapping
> async operations like AE::timer, I think that is the way I'll handle
> things.
Well, personally, I don't really believe strongly in catching unexpected
die's. I'd much rather my graph editor made an emergency save and then bombed
outt hen spittign some message to the console that I'll never read and
continue to silently corrupt my document. Or somesuch. Maybe I believe too
much in crash and restart.
If you really have a case where you have frequent and expected die's (as
part of normal error handling maybe), then doing a wrapper in the vein of
"mysub {}" would probably the right thing to do. Especially if you have a
defined way to report these errors.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
-=====/_/_//_/\_,_/ /_/\_\
More information about the anyevent
mailing list