Fork me on GitHub

Wondering – what would be the best way to manage go-loops, especially within a reloaded workflow? Currently my approach was to just def whatever loops needed to run continually in my programme – but when I reload my repl they don't die. Any best practices around this?


@achesnais: hold refs to channels in a lifecycle component, and close the channels when the component is stopped... your go loops will read nil and can terminate


makes sense – thanks for the prompt answer!


I implemented my component using a "kill channel" this is a channel that the component creates and listens to using alts!. It means that the component can close independently of the input channel closing. Just an alternative idea/implementation


having a global channel registry a la clojure.spec's registry is a potentially useful approach


if you can give meaningful names to your channels:

{[:subsystem/mail #uuid 1234..... ]   chan