Closed matthiasbeyer closed 4 years ago
After the finish() call, the bar gets drawn as complete, but it does not redraw the bar but draws a new bar instead. Maybe that's a hint for you what's happening here.
Do you call MultiProgress::join
? When a ProgressBar
is connected to a MultiProgress
calling ProgressBar::tick
sends new data to MultiProgress
but the MultiProgress
itself needs to be updated as well.
I call MultiProgress::join
after all threads that have a ProgressBar
that was added to the multi-bar are finished (futures are await
ed), yes.
Do you mean I need to join
while updating the progress bars?
Do you mean I need to
join
while updating the progress bars?
Yes, you need. That should fix the issue. Keep in mind that join
blocks the thread until all ProgressBar
s have finished.
It is really inconvenient that I have to manually wrap the MultiProgress
object in an Arc
and move it around, then.
Hm, the longer I try, the more I get the impression that indicatif is not a good choice for async-await
codebases.
Okay, I fixed my issue. Thanks for your support!
@matthiasbeyer what was your final approach to the problem?
Calling MultiProgress::join()
.
Right. There's no way around. Just need some tricks giving the blocking nature of MultiProgress::join
Thanks!
I have a multi-threaded program where I add a ProgressBar with length 100 to a multi bar and then continue to tick() and set_length() the bar (increasing values, as I see in the log output). The bar gets drawn when it initializes, but not afterwards until I finish() it.
How can I debug what's happening here?
Unfortunately, I cannot share the code. Hope you understand and that you can guide me through the process of debugging this anyways!