Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 'total' to be updated during runtime #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DickerDackel
Copy link

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.

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.
Copy link
Contributor

@TheTechRobo TheTechRobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but this PR might very well get outdated when 2.0 is merged.

@rsalmei
Copy link
Owner

rsalmei commented Apr 14, 2021

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.

@TheTechRobo
Copy link
Contributor

@rsalmei what's the status?

@rsalmei
Copy link
Owner

rsalmei commented Feb 8, 2022

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.

@TheTechRobo
Copy link
Contributor

I was asking about your

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

@rsalmei
Copy link
Owner

rsalmei commented Feb 8, 2022

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 rsalmei force-pushed the main branch 14 times, most recently from 9e0e55f to 4e582b7 Compare March 24, 2023 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants