Huey is a small Python task queue with decorators for async jobs, retries, scheduling, and periodic crontab tasks. It stores work in Redis, Postgres, SQLite, filesystem, or in-memory backends.
Overview
Huey lets Python applications enqueue function calls for background workers. Decorating functions with @huey.task() turns them into jobs whose results can be fetched later, scheduled with delays, or retried on failure.
Consumers run separately via the hueyconsumer command, supporting process, thread, or greenlet worker models depending on workload shape. Periodic tasks use crontab-style declarations for nightly or scheduled maintenance work.
Beyond basics, Huey supports prioritization, result storage, task expiration, locking, rate limits, pipelines, groups, and chords. Storage backends include Redis-family brokers, Postgres, SQLite, filesystem, and memory.
Django integration is available natively and through django.tasks, with optional admin views for queue visibility. Documentation covers deployment patterns with systemd, supervisord, Docker Compose, and Kubernetes.
Key features
- Task and periodic task decorators
- Redis Postgres SQLite storage
- Retries delays and cron schedules
- Pipelines groups and chords
- Priority expiration and locking
- Django admin integration
Use cases
- Offload slow Python work
- Run nightly maintenance jobs
- Retry flaky HTTP fetches
- Background jobs in Django