Closed Prnyself closed 4 years ago
And it is possible in some condition that after task done, the bar is still rendering just like canceled mentioned above.
Whoops, I've found what I missed. I didn't call Wait()
when context canceled. So the progress did not shutdown. By the way, maybe consider to make shutdown()
a public method cuz 'shutdown' is quite not familiar with 'wait'?
Glad you solved it.
By the way, maybe consider to make shutdown() a public method cuz 'shutdown' is quite not familiar with 'wait'?
Wait method doesn't shutdown the progress pool, it just waits until underlying bars are completed and completion could be triggered either by normal current == total
or by cancel context.
Wait method waits for opportunity to safely shutdown the progress pool, that's why shutdown method it calls is not a public.
I try to use progress bar in go-prompt,it works well when task completed itself. But, if I interrupted the task by
Ctrl + C
and canceled the context (used to create the progress byNewWithContext
), the progress bar still keeps rendering in my shell, even if I can input new cmd and run it.