Closed Gabriel-Bowater closed 6 years ago
My problem, needed to make the .increment! call in Mutex handler, like:
mutex = Mutex.new
[...]
mutex.synchronize{progress_bar.increment!}
https://ruby-doc.org/core-2.2.0/Mutex.html for posterity
Ah, yeah, while ProgresBar itself is threadsafe, having more than one bar at a time write to the console is not. I'm a little surprised that it split it in half, rather than both bars just clobbering each others' output though.
Hi, I've just had a go at using this bar to replace a bunch of terminal spam in a program I use for batching and compare graph sets. It works great, love the various metrics you can include, but I've come a cross a couple of issues. First one - While it's running it will usually but not always sort of jump the groove and create a new version of the bar graph and other metrics, keeping the progress, but leaving the partially filled version behind. It will do this multiple times on longer operations, but not at a consistent interval. Terminal screen cap attached.
How I'm using it to cause the above :