alive-progress icon indicating copy to clipboard operation
alive-progress copied to clipboard

Allow 'total' to be updated during runtime

Open DickerDackel opened this issue 3 years ago • 5 comments

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.

DickerDackel avatar Apr 08 '21 22:04 DickerDackel

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 avatar Apr 14 '21 02:04 rsalmei

@rsalmei what's the status?

TheTechRobo avatar Feb 08 '22 02:02 TheTechRobo

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.

rsalmei avatar Feb 08 '22 02:02 rsalmei

I was asking about your

I'll think about it and get back to you.

TheTechRobo avatar Feb 08 '22 03:02 TheTechRobo

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. 👍

rsalmei avatar Feb 08 '22 05:02 rsalmei