# taskgraph-rs โ
**A NASA-grade, zero-dependency, no_std DAG task orchestrator library for Rust.**
[](https://github.com/rust-secure-code/safety-dance/)
[](#-license)
## ๐ Vision
`taskgraph-rs` is a lightweight, high-performance engine designed
to execute interdependent tasks (DAG - Directed Acyclic Graph) in
parallel. Built for environments where reliability, safety, and
performance are non-negotiable.
**Core Pillars:**
- **Zero-Unsafe** โ `#![forbid(unsafe_code)]` strictly enforced
- **Zero-Deps** โ No dependencies by default, `no_std` compatible
- **Dual Runtime** โ Sync (`no_std`/IoT) and Async (Tokio) support
- **14.8M tasks/sec** โ Lock-free atomic orchestration, benchmarked
## ๐ฏ Perfect for
โ
IoT & Embedded systems (ESP32, ARM โ runs in < 1KB RAM)
โ
Game engines in Rust (parallel asset loading pipelines)
โ
Medical / Defense (offline, air-gapped, zero cloud)
โ
CLI tools with complex step dependencies
โ
Any Rust app needing a parallel task pipeline
โ Not a replacement for Apache Airflow (no UI, no cron)
โ Not for distributed multi-server workflows
## ๐ฆ Installation
```toml
[dependencies]
taskgraph-rs = "0.1"
# Async support (Tokio)
# taskgraph-rs = { version = "0.1", features = ["async"] }
```
## ๐ ๏ธ Usage
### Synchronous (no_std / IoT / CLI)
```rust
use taskgraph::{Task, TaskGraph, StaticStore};
fn main() -> taskgraph::Result<()> {
let storage = StaticStore::<10>::new()?;
let mut graph = TaskGraph::new(storage);
let id_a = graph.task(Task::new_static("TaskA", || Ok(())), &[])?;
let _id_b = graph.task(Task::new_static("TaskB", || Ok(())), &[id_a])?;
graph.run_sync()?;
Ok(())
}
```
### Asynchronous (Tokio)
```rust
#[tokio::main]
async fn main() -> taskgraph::Result<()> {
let mut graph = TaskGraph::new(taskgraph::DynamicStore::new());
let t = Task::new_async("Fetch", || Box::pin(async { Ok(()) }))
.with_timeout(Duration::from_secs(30))
.with_retries(3);
graph.task(t, &[])?;
graph.run_async().await?;
Ok(())
}
```
## ๐ก๏ธ Security & Reliability
- **No Panics** โ Zero `unwrap()` in the core library
- **Cycle Detection** โ Kahn's Algorithm, deterministic
- **Panic Isolation** โ One task panics, others continue
- **Timeout** โ Async tasks cancelled cleanly on timeout
## โ๏ธ License
Free for non-commercial use โ see [LICENSE](LICENSE)
| Personal / Open Source | Free (MIT) | โ |
| Startup (revenue < $1M/year) | โฌ99 one-time | [Buy Startup License โ](https://buy.polar.sh/polar_cl_MMxcQlmU0iWqiyS76y6L5jolRDgelacR6n4Xg0UfutX) |
| Business (revenue > $1M/year) | โฌ499 one-time | [Buy Business License โ](https://buy.polar.sh/polar_cl_rySzRQLoExTlLjtt2YnQAcPjpqg3XsjQoukqm1dU4Ra) |
---
*Built by [Ferrolab](https://github.com/ferrolab-rs) ยท ferrolab@tutamail.com*