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
{{ message }}
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
It does not seem to be possible to use progressive with rayon's par_iter. I would like to do something like
use progressive::progress;
use rayon::prelude::*;
use std::{thread, time};
fn main() {
let v: Vec<u64> = (0..10).collect();
progress(
v.par_iter()
.map(|n| time::Duration::from_secs(n.to_owned()))
.inspect(|n| {
thread::sleep(n.to_owned());
}),
)
.for_each(|n| {
println!("Slept {:?}", n);
});
println!("Results:")
}
but that does not compile because par_iter and the related functions do not return an Iterator.
Ideally, the above code would produce a progress bar that updates once a second, going from 0 to 11 units of work completed.
I am not familiar with the details of how rayon works, so this is probably at least more complicated than supporting Iterator and could easily be very difficult/impossible.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It does not seem to be possible to use progressive with rayon's par_iter. I would like to do something like
but that does not compile because
par_iter
and the related functions do not return anIterator
.Ideally, the above code would produce a progress bar that updates once a second, going from 0 to 11 units of work completed.
I am not familiar with the details of how rayon works, so this is probably at least more complicated than supporting
Iterator
and could easily be very difficult/impossible.The text was updated successfully, but these errors were encountered: