A high-performance, distributed task queue system built in Rust, featuring Raft consensus algorithm for fault tolerance and strong consistency.
This project implements a complete distributed task queue system combining Rust's safety guarantees with the Raft consensus algorithm. It provides a production-ready foundation for building scalable, fault-tolerant task processing systems.
Key Features:
- Full Raft implementation with leader election and log replication
- Modern Rust stack with Tokio async runtime and Axum HTTP framework
- Real-time web dashboard for monitoring and task management
- RESTful API for task submission and management
- Concurrent task execution with configurable limits
- Automatic retry logic with configurable max attempts
- Rust 1.70+ (install from rustup.rs)
Start the API server:
cd api-server
cargo run --releaseThe API server will start on http://localhost:3000
Start the dashboard (optional):
cd dashboard
cargo run --releaseThe dashboard will be available at http://localhost:8080
POST /api/tasks- Create a new taskGET /api/tasks- List all tasks (optional?status=Pendingfilter)GET /api/tasks/{id}- Get task by IDDELETE /api/tasks/{id}- Cancel a taskGET /api/stats- Get task statisticsGET /health- Health check
Create a task:
curl -X POST http://localhost:3000/api/tasks \
-H "Content-Type: application/json" \
-d '{"name": "compute", "payload": "data", "max_retries": 3}'List tasks:
curl http://localhost:3000/api/tasksThe project is organized as a Cargo workspace:
shared- Common types and message definitionsraft-core- Raft consensus algorithm implementationtask-queue- Task queue and executor logicapi-server- REST API server using Axumdashboard- Web dashboard for monitoring
MIT License