huey, a little task queue — huey 1.3.0 documentation

# huey, a little task queue

a lightweight alternative, huey is:

- written in python
- only dependency is the Python Redis client
- clean and simple APIs

huey supports:

- multi-process, multi-thread or greenlet task execution models
- schedule tasks to execute at a given time, or after a given delay
- schedule recurring tasks, like a crontab
- retry tasks that fail automatically
- task result storage
- consumer event streaming

## Huey’s API

    from huey import RedisHuey, crontab

    huey = RedisHuey('my-app', host='redis.myapp.com')

    @huey.task()
    def add_numbers(a, b):
        return a + b

    @huey.periodic_task(crontab(minute='0', hour='3'))
    def nightly_backup():
        sync_all_data()

To run the consumer with 4 worker processes:

    $ huey_consumer.py my_app.huey -k process -w 4

Huey is named in honor of my cat

Contents:

- Installing
  - Using git
- Getting Started
  - General guide
- Consuming Tasks
  - Options for the consumer
  - Consumer Internals
  - Events
- Consumer Events
  - Listening to events
  - Ordering of events
- Understanding how tasks are imported
  - Suggested organization of code
- Troubleshooting and Common Pitfalls
- Huey’s API
  - Function decorators and helpers
  - TaskResultWrapper
- Huey Extensions
  - SQLite Storage
  - Django

# Indices and tables

- Index
- Module Index
- Search Page