You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a MultiProgress, you need to use a bar's println to avoid the terminal getting messy.
However, if all bars finish, you can't println, even though you could if using a solo ProgressBar.
Possible Solutions
Add a println to the MultiProgress itself.
Add some other type of join to MultiProgress, which continues even after all bars are done.
Add another method to control the pump inside MultiProgress::join, a user can query if it's already done, and switch to regular println!. Something like MultiProgress::single_event(), which returns if the last event was final.
Add another method that lets other threads wait for MultiProgress to finish, which could then switch over to regular println!.
Some combination of the above.
Out of all of these, 1 seems the simplest, and I'd be happy to work on a PR if y'all think it's an appropriate solution.
Background
I'm working on two adapters for indicatif:
One to work in an async runtime that dispatches messages to another thread. Without a way to query if MultiProgress is done, println calls could be dropped, or I'd have to wrap all print calls in another mutex over MultiProgress.
That's complicated. And unless I haven't seen the solution, it's impossible to do without race conditions.
The other adapter will let you use indicatif's bars as a Writer for tracing_subscriber. It more or less has the same issue.
The text was updated successfully, but these errors were encountered:
The Issue
When using a
MultiProgress
, you need to use a bar'sprintln
to avoid the terminal getting messy.However, if all bars finish, you can't
println
, even though you could if using a soloProgressBar
.Possible Solutions
println
to theMultiProgress
itself.join
toMultiProgress
, which continues even after all bars are done.MultiProgress::join
, a user can query if it's already done, and switch to regularprintln!
. Something likeMultiProgress::single_event()
, which returns if the last event was final.MultiProgress
to finish, which could then switch over to regularprintln!
.Out of all of these, 1 seems the simplest, and I'd be happy to work on a PR if y'all think it's an appropriate solution.
Background
I'm working on two adapters for indicatif:
One to work in an
async
runtime that dispatches messages to another thread. Without a way to query ifMultiProgress
is done,println
calls could be dropped, or I'd have to wrap all print calls in another mutex overMultiProgress
.That's complicated. And unless I haven't seen the solution, it's impossible to do without race conditions.
The other adapter will let you use indicatif's bars as a
Writer
for tracing_subscriber. It more or less has the same issue.The text was updated successfully, but these errors were encountered: