MichaelDrogalis / dire

Erlang-style supervisor error handling for Clojure
482 stars 20 forks source link

Concurrent pre/post-hook dispatch? #21

Closed dparis closed 11 years ago

dparis commented 11 years ago

Would there be any worth to adding an option to the with-pre/post-hook methods which indicate that the supplied hook function should be dispatched as a future? Might be pretty sweet in the case where, say, your post-hook was logging success to a networked logging server and incurred some non-zero amount of latency.

Of course, anyone writing the logging function passed to the hook could just do their own concurrency management, but I can see a possible benefit to making it convenient.

MichaelDrogalis commented 11 years ago

Ahh, yeah I had considered this a while ago. I came to the same conclusion. I'd rather let application developers make choices about things like concurrency rather than me. Otherwise we'd end up with an explosion in the number of 'specialty' hooks.

dparis commented 11 years ago

Alright, works for me! Closing out, let me know if you want to re-visit this for some reason.