Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Sep 16, 2024
1 parent 6e81002 commit 6507e2a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions Source/Fn/Binary/Command/Parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> = Command.split(' ').map(String::from).collect();
for Command in &Command {
let Command: Vec<String> = 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::<Vec<()>>().await;
})
.buffer_unordered(num_cpus::get())
.collect::<Vec<()>>()
.await;

drop(Approval);

Expand Down
Binary file modified Target/release/Inn.exe
Binary file not shown.
Binary file modified Target/release/InnKeeper.exe
Binary file not shown.
Binary file modified Target/release/PRun.exe
Binary file not shown.
Binary file modified Target/release/Run.exe
Binary file not shown.

0 comments on commit 6507e2a

Please sign in to comment.