From 1b62918240266fc234abfffb11785839423c57f3 Mon Sep 17 00:00:00 2001 From: George Shuklin Date: Wed, 15 May 2024 04:16:53 +0300 Subject: [PATCH] Add example using GNU parallel to run tasks in concurrently (#1915) --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index dc6df4d..29a7550 100644 --- a/README.md +++ b/README.md @@ -3061,6 +3061,19 @@ watchexec just foo See `watchexec --help` for more info, including how to specify which files should be watched for changes. +### Running tasks in parallel + +GNU parallel can be used to run tasks concurrently: + +```just +parallel: + #!/usr/bin/env -S parallel --shebang --ungroup --jobs {{ num_cpus() }} + echo task 1 start; sleep 3; echo task 1 done + echo task 2 start; sleep 3; echo task 2 done + echo task 3 start; sleep 3; echo task 3 done + echo task 4 start; sleep 3; echo task 4 done +``` + ### Shell Alias For lightning-fast command running, put `alias j=just` in your shell's