Run commands in parallel and aggregate their outputs. Async application using rust and tokio.
See examples for example commands and manual for more details.
Similar interface to GNU Parallel or xargs plus useful features:
* Run commands from stdin, input files, or :::
arguments
* Automatic parallelism to all cpus using, can configure manually.
* Transform inputs with regular expression named or numbered capture groups
* Prevent output interleaving
* Very fast in benchmarks
* Shell mode to run bash functions or other shell commands
* TUI progress bar using indicatif
* Path cache
* Command timeouts
* Structured debug logging
Listed in Awesome Rust - utilities
Recommended:
For manual installation/update:
1. Install Rust
2. Install the latest version of this app from crates.io:
$ cargo install rust-parallel
3. The same cargo install rust-parallel
command will also update to the latest version after initial installation.
multi_cartesian_product
to process :::
command line inputs.-r
/--regex
option.
async
/ await
functions (aka coroutines)CommandLineArgs
instance using tokio::sync::OnceCell
.tokio::process::Command
tokio::sync::Semaphore
used to limit number of commands that run concurrently.tokio::sync::mpsc::channel
used to receive inputs from input task, and to send command outputs to an output writer task. To await command completions, use the elegant property that when all Senders
are dropped the channel is closed.tracing::Instrument
is used to provide structured debug logs.