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

Document better how to show progress in a Progress Bar #1232

Open
massenz opened this issue Mar 28, 2021 · 0 comments
Open

Document better how to show progress in a Progress Bar #1232

massenz opened this issue Mar 28, 2021 · 0 comments
Labels
documentation An improvement required in the project's documentation.

Comments

@massenz
Copy link

massenz commented Mar 28, 2021

Is your feature request related to a problem? Please describe.

It's really no clear at all how to show progress on a bar, while not blocking the app; I am using the App.add_background_task() with a handler and incrementing the value of a ProgressBar as work progresses, but it doesn't show in the UI, until after the handler returns.

This is in a iOS app, and the "blocking" is on IO (so I assume, if I got it right, that asyncio should schedule the UI tasks).

Describe the solution you'd like

It would really be nice to have a clear example, beyond the very basic in the docs, of how to show progress from a background task.
Also an explanation of what the handler is supposed to be doing, and even whether it should return something.
At the moment there is really very little to go on.

Describe alternatives you've considered
I am reverse-engineering the code, looking at the source, and trying in my own code various hacks to try and figure out what is going on.

Additional context
I cannot share the full code, but here is what I arrived at:

  def dumb_task(self, ios_app):
        for i in range(1, 50, 5):
            self.progress.value = i
            print(i)
            yield 0.1
        print("done")
        self.progress.value = 100
        self.progress.stop()

the value that we yield is the delay in getting called back (I assume it's a "best case" if nothing else is going on?)

Anyways, if someone could describe it (or point me to a place which does) I'd be happy to contribute to the docs.
Thanks!

@massenz massenz added the enhancement New features, or improvements to existing features. label Mar 28, 2021
@freakboy3742 freakboy3742 added up-for-grabs documentation An improvement required in the project's documentation. and removed enhancement New features, or improvements to existing features. labels Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An improvement required in the project's documentation.
Projects
None yet
Development

No branches or pull requests

2 participants