3 ms·
I think it's a touch trickier than that. As far as I'm aware, a reload cannot remove namespace mappings; it can just add new ones and overwrite existing ones. S
by weavejester 17y ago
I think it's a touch trickier than that. As far as I'm aware, a reload cannot remove namespace mappings; it can just add new ones and overwrite existing ones. So with continual reloads you might find yourself with old deprecated functions cluttering up your namespace.
Another problem is that Clojure loads up namespaces sequentially, rather than atomically. So you might end up with an a new version of one function calling the old version of another.
In order for your reloading middleware to be robust, I suspect you'd have to (1) wait for any existing request-handling threads to finish, (2) suspend any new request-handling threads, (3) reload your namespaces, (4) resume any suspended request threads.