Re: CPU usage goes way up when closing a core.async channel with loop inside

2017-01-23 Thread Torsten Uhlmann
Thanks for the quick response! I found the problem. I actually had a "pause" inside (this is the go-loop version that had the same problem as the "while true"): (a/go-loop [] (when-let [document (a/ > You do nothing for the while loop to end > > (while true > ... )) > > This will still eat cpu

Re: CPU usage goes way up when closing a core.async channel with loop inside

2017-01-23 Thread Max Penet
You do nothing for the while loop to end (while true ... )) This will still eat cpu time (a lot if there's no "pause" inside, empty chan/takes inside or not. That's why usually you use loop/recur with a condition of the take! result or put! result in case of push. (go-loop [] (when-let [x (

CPU usage goes way up when closing a core.async channel with loop inside

2017-01-23 Thread Torsten Uhlmann
I'm experiencing this weird behavior in my app- when restarting the components of my app some have a core.async channel and a go-loop inside. When trying to close! these channels the cpu usage of my app goes way up, and stays up- as if the loop does some polling. I prepared a minimal example h