{"id":13416136,"url":"https://github.com/coleifer/huey","last_synced_at":"2026-01-06T05:13:42.471Z","repository":{"id":1780275,"uuid":"2703394","full_name":"coleifer/huey","owner":"coleifer","description":"a little task queue for python","archived":false,"fork":false,"pushed_at":"2025-03-19T14:46:50.000Z","size":3677,"stargazers_count":5435,"open_issues_count":0,"forks_count":373,"subscribers_count":87,"default_branch":"master","last_synced_at":"2025-04-22T13:18:30.670Z","etag":null,"topics":["dank","python","queue","redis","task-queue"],"latest_commit_sha":null,"homepage":"https://huey.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coleifer.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-03T16:39:43.000Z","updated_at":"2025-04-22T08:37:06.000Z","dependencies_parsed_at":"2024-01-11T20:51:03.372Z","dependency_job_id":"eb5c40e6-fb08-44fa-8fa9-88e1f66f60ef","html_url":"https://github.com/coleifer/huey","commit_stats":{"total_commits":914,"total_committers":69,"mean_commits":"13.246376811594203","dds":0.2297592997811816,"last_synced_commit":"946563b2b2b68d2c9c7bd5349aa8c919d802538e"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coleifer%2Fhuey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coleifer%2Fhuey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coleifer%2Fhuey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coleifer%2Fhuey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coleifer","download_url":"https://codeload.github.com/coleifer/huey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250246728,"owners_count":21398919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dank","python","queue","redis","task-queue"],"created_at":"2024-07-30T21:00:54.673Z","updated_at":"2026-01-06T05:13:42.422Z","avatar_url":"https://github.com/coleifer.png","language":"Python","funding_links":[],"categories":["Python Packages","Queue","资源列表","Task Queues","Python","Data Pipelines \u0026 Streaming","DevOps","任务队列","HarmonyOS","队列","Third-Party Packages","Task Queues [🔝](#readme)","django","Task Queue","Awesome Python","Task Queues \u0026 Background Jobs","Background Jobs \u0026 Task Queues"],"sub_categories":["Views","队列","Packages","Data Management","Windows Manager","Task Queues","Templates","Queue","ASGI Servers","Test Runners"],"readme":".. image:: http://media.charlesleifer.com/blog/photos/huey2-logo.png\n\n*a lightweight alternative*.\n\nhuey is:\n\n* a task queue\n* written in python\n* clean and simple API\n* redis, sqlite, file-system, or in-memory storage\n* `example code \u003chttps://github.com/coleifer/huey/tree/master/examples/\u003e`_.\n* `read the documentation \u003chttps://huey.readthedocs.io/\u003e`_.\n\nhuey supports:\n\n* multi-process, multi-thread or greenlet task execution models\n* schedule tasks to execute at a given time, or after a given delay\n* schedule recurring tasks, like a crontab\n* automatically retry tasks that fail\n* task prioritization\n* task result storage\n* task expiration\n* task locking\n* task pipelines and chains\n\n.. image:: http://i.imgur.com/2EpRs.jpg\n\nAt a glance\n-----------\n\n.. code-block:: python\n\n    from huey import RedisHuey, crontab\n\n    huey = RedisHuey('my-app', host='redis.myapp.com')\n\n    @huey.task()\n    def add_numbers(a, b):\n        return a + b\n\n    @huey.task(retries=2, retry_delay=60)\n    def flaky_task(url):\n        # This task might fail, in which case it will be retried up to 2 times\n        # with a delay of 60s between retries.\n        return this_might_fail(url)\n\n    @huey.periodic_task(crontab(minute='0', hour='3'))\n    def nightly_backup():\n        sync_all_data()\n\nCalling a ``task``-decorated function will enqueue the function call for\nexecution by the consumer. A special result handle is returned immediately,\nwhich can be used to fetch the result once the task is finished:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e from demo import add_numbers\n    \u003e\u003e\u003e res = add_numbers(1, 2)\n    \u003e\u003e\u003e res\n    \u003cResult: task 6b6f36fc-da0d-4069-b46c-c0d4ccff1df6\u003e\n\n    \u003e\u003e\u003e res()\n    3\n\nTasks can be scheduled to run in the future:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e res = add_numbers.schedule((2, 3), delay=10)  # Will be run in ~10s.\n    \u003e\u003e\u003e res(blocking=True)  # Will block until task finishes, in ~10s.\n    5\n\nFor much more, check out the `guide \u003chttps://huey.readthedocs.io/en/latest/guide.html\u003e`_\nor take a look at the `example code \u003chttps://github.com/coleifer/huey/tree/master/examples/\u003e`_.\n\nRunning the consumer\n^^^^^^^^^^^^^^^^^^^^\n\nRun the consumer with four worker processes:\n\n.. code-block:: console\n\n    $ huey_consumer.py my_app.huey -k process -w 4\n\nTo run the consumer with a single worker thread (default):\n\n.. code-block:: console\n\n    $ huey_consumer.py my_app.huey\n\nIf your work-loads are mostly IO-bound, you can run the consumer with threads\nor greenlets instead. Because greenlets are so lightweight, you can run quite a\nfew of them efficiently:\n\n.. code-block:: console\n\n    $ huey_consumer.py my_app.huey -k greenlet -w 32\n\nStorage\n-------\n\nHuey's design and feature-set were informed by the capabilities of the\n`Redis \u003chttps://redis.io\u003e`_ database. Redis is a fantastic fit for a\nlightweight task queueing library like Huey: it's self-contained, versatile,\nand can be a multi-purpose solution for other web-application tasks like\ncaching, event publishing, analytics, rate-limiting, and more.\n\nAlthough Huey was designed with Redis in mind, the storage system implements a\nsimple API and many other tools could be used instead of Redis if that's your\npreference.\n\nHuey comes with builtin support for Redis, Sqlite and in-memory storage.\n\nDocumentation\n----------------\n\n`See Huey documentation \u003chttps://huey.readthedocs.io/\u003e`_.\n\nProject page\n---------------\n\n`See source code and issue tracker on Github \u003chttps://github.com/coleifer/huey/\u003e`_.\n\nHuey is named in honor of my cat:\n\n.. image:: http://m.charlesleifer.com/t/800x-/blog/photos/p1473037658.76.jpg?key=mD9_qMaKBAuGPi95KzXYqg\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoleifer%2Fhuey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoleifer%2Fhuey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoleifer%2Fhuey/lists"}