-
Notifications
You must be signed in to change notification settings - Fork 60
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
MultiBar only works with threads #59
Comments
I'm currently trying to get it working with |
The following prints nothing, not even the pub(crate) fn bar_test() {
let mb = Arc::new(MultiBar::new());
std::thread::spawn({
let mb = Arc::clone(&mb);
move || {
mb.listen();
}
});
(0..30).into_par_iter().for_each(|n| {
let mut bar = mb.create_bar(100);
bar.message(&format!("{} ", n));
for _ in 0..100 {
bar.inc();
std::thread::sleep(Duration::from_millis(50));
}
bar.finish_print("DONE!");
})
} The process does complete and exit, which means the loops are occuring, but the bars seem to be lost. |
If I add a second |
The only way to display multiple progress bars is to use threads, this requirement isn't documented, and when you use single threads, you get silent failures.
The text was updated successfully, but these errors were encountered: