pb icon indicating copy to clipboard operation
pb copied to clipboard

possibility to update ProgressBar from worker pool

Open beva-sdev opened this issue 3 years ago • 3 comments

Dear Sergey, using your Progress Bar V1 module in few my utilities. So far all is working as expected, many thanks.

Due to amount of tasks need to implement Worker Pool inspired from this Post

Struggling to update the Progress bar from go-routines.

any Idea?

Thanks

beva-sdev avatar Jan 10 '23 14:01 beva-sdev

Found possible solution thanks "gomparator".

Thanks

beva-sdev avatar Jan 11 '23 17:01 beva-sdev

For reference: It's better to allow such things to update asynchronously-yet-linearly: Have the workers send to a channel, and then a single routine updating the bar. Here's a trivial playground to demo: https://go.dev/play/p/oXMK5nFUDuW

cognusion avatar Jan 31 '23 19:01 cognusion

It's absolutely safe to update progressBar from different goroutines.

cheggaaa avatar Feb 01 '23 08:02 cheggaaa