Skip to content

codemonument/concurrently-rust

 
 

Repository files navigation

Concurrently

Run multiple processes concurrently.

Written in Rust with ☕

Install with Cargo

$ cargo install concurrently

Getting Started

Create a tasks.toml file in the root of your project:

[tasks.api]
cargo_workspace_member = true # Run the api cargo package
retries = 3 # Retry 3 times before exiting
delay = 1000 # Wait 1 second before running

[tasks.domain]
cargo_workspace_member = true # Run the api cargo package
release = true # Run in --release mode

[tasks.relay]
# Run a custom command
command = [
  "docker",
  "run",
  "--name=auth-outbox-relay",
  "--net=host",
  "--init",
  "--rm",
  "acidic9/outbox-relay:latest",
  "./outbox-relay -d $DATABASE_URL -r $REDPANDA_HOST",
]
retries = 3 # Retry 3 times before exiting
delay = 1000 # Wait 1 second before running

Now you can simply run concurrently:

$ cargo concurrently

Good to Know

  • watch -n1 -d echo 'Hello from Demo 1 - $(date)' - nice command to generate endless process, problem: does not write to stdout
  • Endless echo loop: while true ; do echo "Hello from Demo 1 - $(date)" ; sleep 1 ; done

Build MacOS Release (when running on MacOS Intel)

  1. cargo build --release

Cross-Compile

Instructions for how to do cross-platform compile: https://kerkour.com/rust-cross-compilation

TL;DR from Mac (Intel) to Windows

  1. Install cargo install -f cross
  2. Run cross build --target x86_64-pc-windows-gnu --release

TL;DR from Mac (Intel) to Linux (WIP)

  1. Run cross build --target x86_64-unknown-linux-gnu --release
  2. Run cross build --target aarch64-unknown-linux-gnu --release

TODO

  • Build github actions pipe to autobuild this tool

About

Run multiple processes concurrently (with rust)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 64.0%
  • TypeScript 23.9%
  • JavaScript 12.1%