Rediq
A distributed task queue framework for Rust based on Redis, inspired by Asynq.
Features
- Simple API: Easy-to-use client and server APIs with builder pattern
- Priority Queues: Support for high-priority tasks (0-100, lower = higher priority)
- Task Retries: Automatic retry with exponential backoff
- Scheduled Tasks: Support for delayed and cron-based tasks
- Task Dependencies: Execute tasks in dependency order
- Task Aggregation: Group tasks for batch processing
- Progress Tracking: Report task execution progress (0-100%)
- Middleware System: Hook into task processing lifecycle
- Metrics: Built-in Prometheus metrics support
- Redis HA: Support for standalone, cluster, and sentinel modes
- Attribute Macros: Simplified handler registration with
#[task_handler]
Installation
Add this to your Cargo.toml:
[]
= "0.2"
= { = "1", = ["full"] }
For attribute macros support:
[]
= { = "0.2", = ["macros"] }
Quick Start
Producer (Client)
use ;
let client = builder
.redis_url
.build
.await?;
let task = builder
.queue
.payload?
.build?;
client.enqueue.await?;
Consumer (Worker)
use ;
use ;
use ;
;
let state = new
.redis_url
.queues
.concurrency
.build
.await?;
let server = from;
let mut mux = new;
mux.handle;
server.run.await?;
Attribute Macros (v0.2.0)
Simplify handler registration with #[task_handler]:
use ;
use ;
async
async
let mux = register_handlers!;
CLI Tool
# Install CLI
# Real-time dashboard
# Queue operations
# Task operations
Documentation
For detailed documentation, examples, and API reference, please visit:
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-Apache-2.0 or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Contributions are welcome! Please feel free to submit a Pull Request.