dire
dire copied to clipboard
Is there an advantage to the supervisor style?
Hi,
I'm curious to know what's the advantage of using the supervisor (erlang style) instead of the *! functions?
Thank You.
@didibus They don't mutate the functions in-place.
And what are the disadvantages of mutating the function in place? Could it lead to issues? What situations should I be aware of where it would be problematic and I should instead use supervisor?
Thank you.
I'm not aware of any issues, but the drawback is that you no longer have your original function. Same set of trade-offs as using a bash-in-place variable.
Ok, I see, so you wouldn't be able to call the function without the hooks being a a part of it anymore.
So there shouldn't be any Clojure specific corner cases to watch out for? Like the possibility that if I use my function too early, it hasn't been hooked up yet, or that it is being changed in the middle of something using it, etc?