Introduction
BlitzQ, a high-performance async task queue for Python built on Redis.
BlitzQ is a high-performance, framework-agnostic task queue for Python, built on
asyncio and Redis. It's part of AiNest Labs.
- Async-native workers: thousands of concurrent
async deftasks per process; sync functions on a bounded thread pool; CPU-bound functions on a process pool. - Two explicit delivery modes: reliable (Redis Streams, at-least-once, crash recovery) and fast (Redis lists, at-most-once, fewest round-trips).
- Retries with backoff and jitter, dead letters, delayed tasks, periodic tasks, timeouts, cancellation, results, multiple queues with per-queue concurrency, task priority within a queue, cross-worker rate limiting.
- Framework-agnostic core with optional FastAPI/Starlette, Django and Flask helpers.
- Measured against Celery with a reproducible benchmark suite.
Status
1.0.0, published on PyPI: pip install blitzq.
Requirements
- Python 3.12 or 3.13
- Redis 7.0+ (tested with 7.4). Redis Cluster is not supported.
- Runtime dependencies:
redis(redis-py ≥ 5),msgspec,typer
See Installation for setup details.
Quick start
# app.py
import asyncio
from blitzq import Queue, RetryPolicy
queue = Queue(name="default", redis_url="redis://localhost:6379/0")
@queue.task(retries=3, retry_policy=RetryPolicy(initial_delay=1, max_delay=60, backoff=2, jitter=True))
async def process_order(order_id: str) -> dict:
return {"order_id": order_id, "processed": True}
async def main():
task = await process_order.enqueue("ORD-123")
print(task.id)
result = await queue.get_result(task.id, timeout=10)
print(result) # {'order_id': 'ORD-123', 'processed': True}
if __name__ == "__main__":
asyncio.run(main())blitzq worker app:queue # terminal 1: executes tasks
python app.py # terminal 2: enqueues and waits for the resultRunnable examples live in examples/
in the repository: basic tasks, multiple queues, retries, scheduling, FastAPI,
Flask and Django.
Where to go next
Installation
Requirements, install steps, and running Redis.
Architecture
How BlitzQ is put together.
Delivery Guarantees
Reliable vs. fast delivery modes.
Framework Integration
FastAPI, Django and Flask helpers.
Operations
Running BlitzQ in production.
Performance Tuning
Getting the most throughput.
Benchmarking
Methodology and how to reproduce results.
Roadmap
Known gaps, why they exist, and what's already been fixed.
API Reference
Generated reference for the blitzq package.