hoplon / castra

HTTP remote procedure call handler for Clojure.
170 stars 25 forks source link

api.core gets executed N times on first compile and load #27

Open burn2delete opened 6 years ago

burn2delete commented 6 years ago

Original Issue: https://github.com/hoplon/hoplon/issues/120

Issue Comment: https://github.com/hoplon/hoplon/issues/120#issuecomment-208216886

So my colleague appears to have found the issue.

wrap-castra "requires" the api on runtime, but if the environment is multithreaded, the call to api happens as many times as there are threads. The workaround he found was to just require it in the ns declaration so that it happens predictably on initialization.