DEV Community

Cover image for πŸš€ Announcing taskflow-rs: A Task Graph Runtime for Rust
ZigRazor
ZigRazor

Posted on

πŸš€ Announcing taskflow-rs: A Task Graph Runtime for Rust

πŸš€ Announcing taskflow-rs: A Task Graph Runtime for Rust

Today I’m excited to share the first public release of taskflow-rs, a Rust library for building and executing task dependency graphs.

GitHub: https://github.com/ZigRazor/taskflow-rs


The Problem

Many parallel workloads can be expressed as a Directed Acyclic Graph (DAG) of tasks.

Examples include:

β€’ data processing pipelines
β€’ build systems
β€’ simulation workflows
β€’ parallel algorithms

However, orchestrating these dependencies efficiently often requires writing complex scheduling logic or relying on abstractions that don’t model task dependencies explicitly.


The Idea

taskflow-rs allows you to define tasks and dependencies directly as a graph, and then execute them using a parallel scheduler.

Instead of thinking in terms of threads or async calls, you describe what depends on what.

The runtime handles the rest.


Example

use taskflow::*;

fn main() {
    let mut tf = Taskflow::new();

    let a = tf.add_task(|| println!("Task A"));
    let b = tf.add_task(|| println!("Task B"));
    let c = tf.add_task(|| println!("Task C"));

    tf.add_dependency(a, c);
    tf.add_dependency(b, c);

    tf.execute();
}
Enter fullscreen mode Exit fullscreen mode

This produces the following execution graph:

A ─┐
   β”œβ”€β”€β–Ί C
B β”€β”˜
Enter fullscreen mode Exit fullscreen mode

Tasks A and B run in parallel, and C runs when both complete.


Features

Current features include:

β€’ Task DAG execution
β€’ Parallel task scheduling
β€’ Lightweight task creation
β€’ Deterministic dependency ordering

Future plans include:

β€’ async task nodes
β€’ distributed task graphs
β€’ advanced scheduling strategies


Why I Built This

I’ve always liked the task graph execution model because it expresses parallelism naturally and explicitly.

While Rust has excellent tools like Rayon and Tokio, they solve different problems.

taskflow-rs explores a DAG-driven execution model where the focus is on dependency graphs rather than threads or futures.


Status

The project is currently in an early stage (v0.x) and the API may evolve, but the goal is to grow it into a high-performance task graph runtime for Rust.

Feedback, ideas, and contributions are very welcome.


Get Involved

If this sounds interesting:

⭐ Star the project
πŸ› Report issues
πŸ’‘ Suggest features
🀝 Contribute

GitHub:
https://github.com/ZigRazor/taskflow-rs


Thanks for reading β€” I’d love to hear your thoughts from the Rust community!

Top comments (0)