alive-progress
alive-progress copied to clipboard
Allow 'total' to be updated during runtime
Use-Case:
I have a multi-threaded program, where one thread traverses a large
directory tee to searches for files
to work on. A second thread works on these files, even when the
first thread is still searching.
So while there is already work happening, the list of files to
process can still continue to grow.
This patch adds the functionality to update the total value to
handle this use case.
How: I adapted the mechanism as used in the 'bar.current()' attribute and applied it to the variables 'total', 'logic_total' and 'gen_eta'.
Also a function bar.update_total(nn) has been added, that
regenerates all 3 values appropriately.
Yeah, it does indeed, thank you @DickerDackel. I'd change a few things though, like removing the duplicated gen_eta for example, but it's minor. Great idea and implementation!
But unfortunately I'm on the brink of releasing something really big, look #51 So I'm not sure how to proceed... I'll think about it and get back to you.
@rsalmei what's the status?
Hello @TheTechRobo, What do you mean by "what's the status"? I'm not working on this. Maybe I could try to recover it someday if the sender wouldn't, but I can't atm.
I was asking about your
I'll think about it and get back to you.
Ohh, I see! You're right! 😬 I did say I was going to think about it! Well, I did, but forgot to return here... I'll take a look again soon, and can try to re-do it. 👍