Metadata-Version: 2.4
Name: asyncmq
Version: 0.7.0
Summary: Async task queue with BullMQ-like features
Project-URL: Homepage, https://github.com/dymmond/asyncmq
Project-URL: Documentation, https://asyncmq.dymmond.com
Project-URL: Changelog, https://asyncmq.dymmond.com/release-notes/
Project-URL: Funding, https://github.com/sponsors/tarsil
Project-URL: Source, https://github.com/dymmond/asyncmq
Author-email: Tiago Silva <tiago@tarsild.io>
License-File: LICENSE
Keywords: anyio,asyncio,background-jobs,celery-alternative,concurrency,cron,dead-letter-queue,esmerald,fastapi,job-scheduler,microservices,mongodb,parallelism,postgresql,rate-limiter,ravyn,redis,retry-policy,task-queue
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: AnyIO
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: croniter<7.0.0,>=6.0.0
Requires-Dist: lilya[standard]>=0.24.3
Requires-Dist: redis>=7.0.0
Requires-Dist: sayer>=0.7.4
Provides-Extra: aio-pika
Requires-Dist: aio-pika>=9.5.8; extra == 'aio-pika'
Provides-Extra: all
Requires-Dist: aio-pika>=9.5.8; extra == 'all'
Requires-Dist: asyncpg>=0.30.0; extra == 'all'
Requires-Dist: motor>=3.7.0; extra == 'all'
Provides-Extra: mongo
Requires-Dist: motor>=3.7.0; extra == 'mongo'
Provides-Extra: postgres
Requires-Dist: asyncpg>=0.30.0; extra == 'postgres'
Provides-Extra: testing
Requires-Dist: aio-pika>=9.5.5; extra == 'testing'
Requires-Dist: anyio[trio]<6.0.0,>=4.9.0; extra == 'testing'
Requires-Dist: autoflake<3.0.0,>=2.0.2; extra == 'testing'
Requires-Dist: black<25.0,==24.1.1; extra == 'testing'
Requires-Dist: fastapi; extra == 'testing'
Requires-Dist: httpx; extra == 'testing'
Requires-Dist: ipdb; extra == 'testing'
Requires-Dist: isort<6.0.0,>=5.12.0; extra == 'testing'
Requires-Dist: pyjwt; extra == 'testing'
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'testing'
Requires-Dist: pytest-codspeed>=4.3.0; extra == 'testing'
Requires-Dist: pytest-cov<5.0.0,>=4.0.0; extra == 'testing'
Requires-Dist: pytest<9.0.0,>=7.2.2; extra == 'testing'
Requires-Dist: structlog>=25.3.0; extra == 'testing'
Requires-Dist: uvicorn>=0.34.2; extra == 'testing'
Description-Content-Type: text/markdown

# AsyncMQ

<p align="center">
  <a href="https://asyncmq.dymmond.com"><img src="https://res.cloudinary.com/dymmond/image/upload/v1746002620/asyncmq/oq2qhgqdlra7rudxaqhl.png" alt="AsyncMQ Logo"></a>
</p>

<p align="center">
  <span>⚡ Supercharge your async applications with tasks so fast, you'll think you're bending time itself. ⚡</span>
</p>

<p align="center">
  <a href="https://github.com/dymmond/asyncmq/actions/workflows/test-suite.yml/badge.svg?event=push&branch=main" target="_blank">
    <img src="https://github.com/dymmond/asyncmq/actions/workflows/test-suite.yml/badge.svg?event=push&branch=main" alt="Test Suite">
  </a>
  <a href="https://pypi.org/project/asyncmq" target="_blank">
    <img src="https://img.shields.io/pypi/v/asyncmq?color=%2334D058&label=pypi%20package" alt="Package version">
  </a>
  <a href="https://img.shields.io/pypi/pyversions/asyncmq.svg?color=%2334D058" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/asyncmq.svg?color=%2334D058" alt="Supported Python versions">
  </a>
</p>

---

**Documentation**: [https://asyncmq.dymmond.com](https://asyncmq.dymmond.com) 📚

**Source Code**: [https://github.com/dymmond/asyncmq](https://github.com/dymmond/asyncmq)

**The official supported version is always the latest released**.

---

AsyncMQ is an asynchronous Python job queue focused on `asyncio`/`anyio` workloads.

It gives you:
- task registration via `@task`
- queue and worker runtime APIs
- delayed jobs, retries/backoff, TTL expiration, and dead-letter routing
- multiple backends (`Redis`, `Postgres`, `MongoDB`, `RabbitMQ`, in-memory)
- a CLI (`asyncmq`) and a built-in dashboard app

## What AsyncMQ Is (and Is Not)

AsyncMQ is:

- a library-first queue/worker runtime you embed in Python apps
- backend-pluggable through a shared `BaseBackend` contract
- suitable for both local development and production deployments

AsyncMQ is not:

- a hosted queue service
- a guaranteed exactly-once execution system
- a replacement for domain-level idempotency in your task code

## Architecture Overview

At runtime, AsyncMQ has four main layers:

1. Task registration: `@task(queue=...)` stores handlers in `TASK_REGISTRY` and adds `.enqueue()` helpers.
2. Queue API: `Queue` wraps backend operations (`enqueue`, `pause`, `list_jobs`, delayed/repeatable APIs).
3. Worker runtime: `process_job`/`handle_job` run tasks, manage state transitions, retries, and acknowledgements.
4. Backend and store: concrete backends persist job state and queue metadata.

For an end-to-end walkthrough, start with [Core Concepts](features/core-concepts.md).

## Feature Map

- [Installation](installation.md)
- [Quickstart](features/quickstart.md)
- [Tasks](features/tasks.md)
- [Queues](features/queues.md)
- [Workers](features/workers.md)
- [CLI](features/cli.md)
- [Dashboard](dashboard/dashboard.md)
- [Troubleshooting](troubleshooting.md)

## Minimal Quickstart (In-Memory)

Use in-memory backend first so you can run without Redis/Postgres.

```python
# myapp/settings.py
from asyncmq.backends.memory import InMemoryBackend
from asyncmq.conf.global_settings import Settings


class AppSettings(Settings):
    backend = InMemoryBackend()
```

```bash
export ASYNCMQ_SETTINGS_MODULE=myapp.settings.AppSettings
```

```python
# myapp/tasks.py
from asyncmq.tasks import task


@task(queue="emails", retries=2, ttl=300)
async def send_welcome(email: str) -> None:
    print(f"sent welcome email to {email}")
```

```python
# producer.py
import anyio
from asyncmq.queues import Queue
from myapp.tasks import send_welcome


async def main() -> None:
    queue = Queue("emails")
    job_id = await send_welcome.enqueue("alice@example.com", backend=queue.backend)
    print("enqueued", job_id)


anyio.run(main)
```

```bash
asyncmq worker start emails --concurrency 1
```
