I'm a bit unsure of which channels will be collected and which will remain and potentially result in an out of memory error. I'd like to understand when I should close, unsub and untap channels to avoid leaks. It feels like a very difficult task to verify there are no leaks.
For example:
(defn read-one-msg [source]
(let [c (async/chan)]
(async/sub source :msg c)
(async/<!! c)))
Will this leak c, should I manually unsub it?
I constantly stumble on this kind of questions so I'd like to understand better how to deal with these situations.