MCPcopy Index your code
hub / github.com/ctbur/async

github.com/ctbur/async @v0.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.1 ↗ · + Follow
52 symbols 100 edges 4 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

async

async is a tool to run shell commands in parallel and is designed to be able to quickly parallelize shell scripts with minimal changes. It was inspired by GNU Parallel, with the main difference being that async retains state between commands by running a server in the background.

Usage

All information about the command line interface is available using async --help. Below is an example on how to use async to parallelize commands:

#!/bin/bash
S="/tmp/example_socket"

async -s="$S" server --start

for i in {1..20}; do
    # prints command output to stdout
    async -s="$S" cmd -- bash -c "sleep 1 && echo test $i"
done

# wait until all commands are finished
async -s="$S" wait

# configure the server to run four commands in parallel
async -s="$S" server -j4

mkdir "/tmp/ex_dir"
for i in {21..40}; do
    # redirects command output to /tmp/ex_dir/file*
    async -s="$S" cmd -o "/tmp/ex_dir/file$i" -- bash -c "sleep 1 && echo test $i"
done

async -s="$S" wait

# stops server
async -s="$S" server --stop

If you encounter an unexpected error or crash, please turn on logging by setting the environment variable RUST_LOG=debug and open an issue on the Github repository.

Installation

async can be installed using cargo with cargo install async-cmd or from the AUR.

Extension points exported contracts — how you extend this code

ResultExt (Interface)
(no doc) [1 implementers]
src/error.rs

Core symbols most depended-on inside this repo

with_context
called by 7
src/error.rs
transmit
called by 5
src/comm.rs
receive
called by 5
src/comm.rs
wait
called by 3
src/exec.rs
run_cmd
called by 2
src/exec.rs
reconfigure
called by 2
src/exec.rs
is_done
called by 2
src/exec.rs
take_results
called by 2
src/exec.rs

Shape

Method 24
Function 12
Class 11
Enum 4
Interface 1

Languages

Rust100%

Modules by API surface

src/exec.rs23 symbols
src/comm.rs14 symbols
src/error.rs9 symbols
src/main.rs6 symbols

For agents

$ claude mcp add async \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact