-
Notifications
You must be signed in to change notification settings - Fork 236
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
Is it possible to use MultiProgress with Rayon? #77
Comments
The |
Hi @andreivasiliu Thanks for the explanation about what So I guess I should remove Rayon from this sample and |
I think your usage of rayon is really appropriate, you just need to start another thread the classic way before the par_iter loop, make that thread With that said, you don't seem to be the only one confused by how MultiProgress works, so #33 would be useful to have. |
I did get my program to work thanks to your suggestion @andreivasiliu so I'll close this issue. I do note however that the drawing speed of MultiProgress is really slow when you have many bars, especially on Windows. I presume the authors are aware of that. |
Here's what I did:
|
The above solution causes the progress bars to remain on the screen after they are complete even if .join_and_clear() is used. |
This comment has been minimized.
This comment has been minimized.
@mibac138 if you read my comment I made clear that that doesn't work. |
It's my first time using Rayon and Indicatif so apologies if this is a naive question. I'm trying to use Rayon to iterate over a set of files. Code is like this:
Inside
process_log_file
I am creating a newProgressBar
, adding it to mp, incrementing it and eventually callingfinish
.As the comments say, the problem is that nothing appears until Rayon's par_iter has actually finished doing work. You have lots of examples of using
thread::spawn
and a tokio example, but I couldn't see anything like this.Is there a fix I can make or is it impossible at the moment?
For reference, the current code in complete form is at https://github.com/PhilipDaniels/log-file-processor/blob/f-rewrite/src/main.rs
Thanks for any advice you can offer.
The text was updated successfully, but these errors were encountered: