diff --git a/Source/Fn/Binary/Command/Parallel.rs b/Source/Fn/Binary/Command/Parallel.rs index 5d7d0a3..7cd77f4 100644 --- a/Source/Fn/Binary/Command/Parallel.rs +++ b/Source/Fn/Binary/Command/Parallel.rs @@ -26,31 +26,33 @@ pub async fn Fn(Option { Entry, Separator, Pattern, Command, .. }: Option) { .await .expect("Cannot blocking."); - let Command = Entry.into_iter().map(|Entry| { - let Command = Command.clone(); - let Approval = Approval.clone(); + futures::stream::iter(Entry.into_iter()) + .map(|Entry| { + let Command = Command.clone(); + let Approval = Approval.clone(); - async move { - let mut Output = Vec::new(); + async move { + let mut Output = Vec::new(); - for Command in &Command { - let Command: Vec = Command.split(' ').map(String::from).collect(); + for Command in &Command { + let Command: Vec = Command.split(' ').map(String::from).collect(); - if GPG::Fn(&Command) { - let Lock = GPG_MUTEX.lock().await; - drop(Lock); - } + if GPG::Fn(&Command) { + let Lock = GPG_MUTEX.lock().await; + drop(Lock); + } - Output.push(Process::Fn(&Command, &Entry).await); - } + Output.push(Process::Fn(&Command, &Entry).await); + } - if let Err(_) = Approval.send(Output) { - eprintln!("Cannot send."); + if let Err(_) = Approval.send(Output) { + eprintln!("Cannot send."); + } } - } - }); - - futures::stream::iter(Command).buffer_unordered(num_cpus::get()).collect::>().await; + }) + .buffer_unordered(num_cpus::get()) + .collect::>() + .await; drop(Approval); diff --git a/Target/release/Inn.exe b/Target/release/Inn.exe index 50d235a..2f82ee8 100644 Binary files a/Target/release/Inn.exe and b/Target/release/Inn.exe differ diff --git a/Target/release/InnKeeper.exe b/Target/release/InnKeeper.exe index 6fd29e0..af81b80 100644 Binary files a/Target/release/InnKeeper.exe and b/Target/release/InnKeeper.exe differ diff --git a/Target/release/PRun.exe b/Target/release/PRun.exe index 422bc3d..a3e89fa 100644 Binary files a/Target/release/PRun.exe and b/Target/release/PRun.exe differ diff --git a/Target/release/Run.exe b/Target/release/Run.exe index c01e149..f75cf11 100644 Binary files a/Target/release/Run.exe and b/Target/release/Run.exe differ