whatisgithub

What is huey?

coleifer/huey — explained in plain English

Analysis updated 2026-06-26

5,952PythonAudience · developerComplexity · 2/5Setup · easy

In one sentence

Huey is a lightweight Python library for running tasks in the background so users do not have to wait for slow operations. Add a decorator to any function and calling it queues it for a worker process, supports Redis, SQLite, recurring cron-style jobs, retries, and chaining.

Mindmap

mindmap
  root((repo))
    What it does
      Background task queue
      Scheduled jobs
      Recurring cron tasks
    Tech Stack
      Python
      Redis
      SQLite
    Use Cases
      Background email sending
      Nightly reports
      Retry on failure
    Audience
      Python developers
      Web app builders
    Features
      Task chains
      Fan-out groups
      Priority queues
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Offload slow tasks like sending emails or processing images to a background worker so web responses return instantly.

USE CASE 2

Schedule a recurring nightly job like a database cleanup or report generation using Huey's cron-like syntax.

USE CASE 3

Automatically retry a failed task up to a set number of times with a configurable delay between attempts.

USE CASE 4

Fan out one triggering task into many parallel background tasks and wait for all of their results.

What is it built with?

PythonRedisSQLiteValkey

How does it compare?

coleifer/hueyom-ai-lab/vlm-r1cubiq/comfyui_ipadapter_plus
Stars5,9525,9565,957
LanguagePythonPythonPython
Setup difficultyeasyhardhard
Complexity2/55/53/5
Audiencedeveloperresearcherdesigner

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Redis is the recommended storage backend, SQLite and in-memory options are available for development or simpler deployments.

So what is it?

Huey is a lightweight task queue library for Python. A task queue is a system that lets your application hand off work to be done in the background, rather than making a user wait while the server completes a slow operation. You mark a Python function as a task, and when you call it, the function is added to a queue and processed separately by a worker process. The library supports several storage backends for holding queued tasks: Redis (and its forks Valkey and Redict), SQLite, the file system, or plain in-memory storage. Redis is the primary option the project was designed around, but the others exist for situations where Redis is not available or not desired. Beyond basic queuing, Huey supports scheduling tasks to run at a specific future time or after a set delay, and setting up recurring tasks that run on a schedule similar to cron jobs. It also handles automatic retries when a task fails, task priorities, storing the results of completed tasks so you can retrieve them later, timeouts, rate limiting, and more advanced patterns like chains (one task runs after another) and fan-out groups where one task triggers many others. The worker process that actually runs the queued tasks is started separately from your application using a command-line tool included with the library. You can configure it to run multiple worker processes, threads, or lightweight greenlets depending on whether your tasks are mostly CPU-heavy or network/IO-heavy. Huey's API is designed to be simple: you add a decorator to a function, and calling that function queues it instead of running it immediately. The README includes short code examples showing how to queue a function, retry on failure, schedule a future task, and set up a nightly recurring job. Documentation is available at huey.readthedocs.io.

Copy-paste prompts

Prompt 1
I am using Huey with Redis in my Python web app. Show me how to decorate a function to run as a background task and start the Huey worker process from the command line.
Prompt 2
How do I set up a recurring task in Huey that runs every night at midnight, like sending a daily digest email?
Prompt 3
How do I configure Huey to automatically retry a failed task up to 3 times with a delay between each retry?
Prompt 4
Show me how to use Huey task chains so a second task only runs after the first one finishes successfully.
Prompt 5
I want to use Huey without Redis, how do I configure it to use SQLite as the storage backend?

Frequently asked questions

What is huey?

Huey is a lightweight Python library for running tasks in the background so users do not have to wait for slow operations. Add a decorator to any function and calling it queues it for a worker process, supports Redis, SQLite, recurring cron-style jobs, retries, and chaining.

What language is huey written in?

Mainly Python. The stack also includes Python, Redis, SQLite.

How hard is huey to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is huey for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.