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

clarifications on the lifecycle of progress bars #652

Open
djugei opened this issue Jul 29, 2024 · 4 comments
Open

clarifications on the lifecycle of progress bars #652

djugei opened this issue Jul 29, 2024 · 4 comments

Comments

@djugei
Copy link
Contributor

djugei commented Jul 29, 2024

There is currently multiple apparent ways to get rid of a progress bar:

  • drop all references to it
  • call reset()
  • call finish()
  • call finish_and_clear()
  • call abandon()

even after reading the documentation i personally do not understand the difference between them, even though i am somewhat sure that reset() does not even belong in the list.

please clarify the lifecycle of a progress bar, what happens on drop and what the different finalizers do. also handle the special cases when you want to re-use that specific progressbar instance to display the progress of a different process and the case where the progressbar is part of a multiprogress.

also, apparently slightly related: more strongly differentiate prefix and message.

@djc
Copy link
Member

djc commented Jul 29, 2024

What problem are you trying to solve? Which documentation have you tried to consume which failed to clarify things for you, and why?

@chris-laplante
Copy link
Collaborator

Related: #595

@djugei
Copy link
Contributor Author

djugei commented Jul 29, 2024

i am trying to display multiple progressbars to users, since this is hard to test for correctness i would like to build a solid mental model and get things right the first time.

i have read the top level crate documentation and the entire documentation on progressbar and multiprogress plus some others and have read and contributed some of the crates code.

specifically the documentation for the initially mentioned methods does, to my eye, not meaningfully differ, additionally it mainly restates the functions name, not so much what will actually happen on calling it. behaviour on drop is afaik undocumented.

@djc
Copy link
Member

djc commented Aug 1, 2024

I'm sorry, I won't have time to go digging through the source code to clarify the lifecycle here. I suggest you spend some time looking at the implementation yourself and ask more specific questions about it if that doesn't clarify things enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants