
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
async-task-q
Advanced tools
A modern, async-first, type-safe task queue Python package inspired by Laravel. Native FastAPI integration. Switch between multiple queue backends (Memory, Redis, PostgreSQL, MySQL, RabbitMQ, AWS SQS) with one config line. Automatic, smart ORM serialization using msgpack reduces payloads by 90%+.
A modern, async-first, type-safe task queue Python package inspired by Laravel. Native FastAPI integration. Switch between multiple queue backends (Redis, PostgreSQL, MySQL, RabbitMQ, AWS SQS) with one config line. Automatic ORM serialization (SQLAlchemy, Django, Tortoise) using msgpack reduces payloads by 90%+. Features ACID guarantees, dead-letter queues, crash recovery.
use_bin_type=True for optimal bytes processingshould_retry() hooks.delay(60).on_queue("high").dispatch()β Async-first design with asyncio throughout the stack
β Multiple queue drivers: Redis, PostgreSQL, MySQL, RabbitMQ, AWS SQS
β High-performance msgpack serialization with binary support
β Automatic ORM model handling for SQLAlchemy, Django, Tortoise
β Type-safe with full type hints and Generic support
β Configurable retries with custom retry logic hooks
β Task timeouts to prevent runaway tasks
β Delayed task execution with precision timing
β Queue priority with multiple queues per worker
β Graceful shutdown with signal handlers
β ACID guarantees (PostgreSQL/MySQL drivers)
β Dead-letter queues for failed task inspection
β Visibility timeouts for crash recovery
β Connection pooling for optimal resource usage
β
Transactional dequeue with SELECT FOR UPDATE SKIP LOCKED
β Task metadata tracking (attempts, timestamps, task IDs)
β Concurrent processing with configurable worker concurrency
β FastAPI β Automatic lifecycle management, dependency injection
β SQLAlchemy β Async and sync model serialization
β Django ORM β Native async support (Django 3.1+)
β Tortoise ORM β Full async ORM integration
β Comprehensive CLI β Worker management and database migrations
β
Function-based tasks with @task decorator
β
Class-based tasks with lifecycle hooks (handle, failed, should_retry)
β Method chaining for fluent task configuration
β Environment variable configuration for 12-factor apps
Get started in 60 seconds:
# Install Async Task Q
uv add async-task-q[redis]
import asyncio
from async_task_q.config import set_global_config
from async_task_q.core.task import task
# 1. Configure (or use environment variables)
set_global_config(driver="redis", redis_url="redis://localhost:6379", redis_password=None)
# 2. Define a task
@task
async def send_email(to: str, subject: str, body: str):
print(f"Sending email to {to}: {subject}")
await asyncio.sleep(1) # Simulate email sending
return f"Email sent to {to}"
# 3. Dispatch the task
async def main():
for i in range(10):
task_id = await send_email.dispatch(
to=f"user{i}@example.com", subject=f"Welcome {i}!", body="Welcome to our platform!"
)
print(f"Task dispatched: {task_id}")
if __name__ == "__main__":
asyncio.run(main())
# Run the worker
python -m async_task_q worker
That's it! Your first async task queue is ready. Now let's explore the powerful features.
just init β install deps and pre-commit hooksjust services-up β Redis, PostgreSQL, MySQL, RabbitMQ, LocalStack (SQS) for local integration testsjust test (or pytest) β use just test-unit / just test-integration to scopejust test-cov or pytest --cov=src/async_task_q --cov-report=htmlpython -m async_task_q worker./setup-pre-commit.sh or just setup-hooksjust format, just lint, just typecheckmain and includes lint, type checks and tests across Python 3.11β3.14../setup-pre-commit.sh).main..github/coverage.svg automatically via .github/workflows/coverage-badge.yml.just ci (runs format/lint/typecheck/tests like the workflow).| Feature | Async Task Q | Celery |
|---|---|---|
| Async Support | β Async-first, built with asyncio | β No native asyncio support |
| Type Safety | β Full type hints, Generic[T] | β οΈ Third-party stubs (celery-types) |
| Multi-Driver | β 5 drivers (Redis/PostgreSQL/MySQL/RabbitMQ/SQS) | β οΈ Redis/RabbitMQ/SQS brokers |
| ORM Integration | β Auto-serialization (SQLAlchemy/Django/Tortoise) | β Manual serialization |
| Serialization | β msgpack (fast, binary) | β οΈ JSON/pickle (slower) |
| FastAPI Integration | β First-class, lifespan management | β οΈ Manual setup |
| Dead-Letter Queue | β Built-in (PG/MySQL) | β οΈ Manual setup (RabbitMQ DLX) |
| ACID Guarantees | β PostgreSQL/MySQL drivers | β Not available |
| Setup Complexity | β Zero-config with env vars | β οΈ Complex configuration |
| Learning Curve | β Simple, intuitive API | β οΈ Steep learning curve |
When to use Async Task Q:
When to use Celery:
| Feature | Async Task Q | Dramatiq |
|---|---|---|
| Async Support | β Async-first | β οΈ Limited (via middleware) |
| Type Safety | β Full type hints | β Type hints (py.typed) |
| Multi-Driver | β 5 drivers | β οΈ Redis/RabbitMQ |
| ORM Integration | β Auto-serialization | β Manual serialization |
| Dead-Letter Queue | β Built-in | β Built-in |
| FastAPI Integration | β First-class | β οΈ Manual setup |
| Database Drivers | β PostgreSQL/MySQL | β Not available |
| Simplicity | β Clean, intuitive API | β Simple, well-designed |
When to use Async Task Q:
When to use Dramatiq:
| Feature | Async Task Q | RQ |
|---|---|---|
| Async Support | β Async-first | β Sync only |
| Multi-Driver | β 5 drivers | β Redis only |
| Type Safety | β Full type hints | β Type hints added |
| Retries | β Configurable with custom logic | β Configurable retries |
| Dead-Letter Queue | β Built-in | β Not available |
| Database Drivers | β PostgreSQL/MySQL | β Not available |
| Simplicity | β Intuitive, clean API | β Very simple |
When to use Async Task Q:
When to use RQ:
| Feature | Async Task Q | Huey |
|---|---|---|
| Async Support | β Async-first | β οΈ Limited async |
| Multi-Driver | β 5 drivers | β οΈ Redis/SQLite |
| Type Safety | β Full type hints | β Limited |
| ORM Integration | β Auto-serialization | β Manual |
| Enterprise Features | β ACID, DLQ, visibility timeout | β οΈ Basic features |
| Simplicity | β Clean, modern API | β Simple |
When to use Async Task Q:
When to use Huey:
Async Task Q stands out with:
For detailed documentation, see the following guides:
For complete examples, see the following guides:
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
MIT License β see LICENSE file for details.
Built with β€οΈ by Adam Refaey.
FAQs
A modern, async-first, type-safe task queue Python package inspired by Laravel. Native FastAPI integration. Switch between multiple queue backends (Memory, Redis, PostgreSQL, MySQL, RabbitMQ, AWS SQS) with one config line. Automatic, smart ORM serialization using msgpack reduces payloads by 90%+.
We found that async-task-q demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: whatβs affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.