Closed malchmih closed 8 years ago
@malchmih: I see the problem. It does not really have to do with tools.namespace
, but with recompiling the namespace without calling (mount/stop)
beforehand.
One way to solve this would be to remember all the states that were stopped, and if a state "was not stopped & it is not brand new", when (mount/start)
is called, instead of just starting it, do stop & start
.
This would work for both: regular states, and suspendable that are used with (mount/stop-except)
.
Need to think a bit more about it though. Since stop & start
on start for dirty states does not feel clean and expected.
Great, it's a bit simpler. My first understanding of the problem was depressing :smile: It won't be a showstopper anyway, suspendable states are usually leaves in the the dependency tree. But would be great to solve this :wink:
@tolitius Works great, thank you! Could you upload snapshot to clojars?
@malchmih great. the snapshot should have the latest, did it not work for you?
My bad, missed it :smile:
So when I edit some namespace with
defstate
in it,refresh
destroys it completely. Which leads toport is already in use
for instance. More info: https://github.com/clojure/tools.namespace#reloading-code-preparing-your-application. Don't know how to solve this.