seedofjoy / darq

Async task manager with Celery-like features. Fork of arq.

Home Page:http://darq.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

darq

[ ~ Dependencies scanned by PyUp.io ~ ]

image

image

Async task manager with Celery-like features. Fork of arq.

Features

  • Celery-like @task decorator, adds .delay() to enqueue job
  • Proper mypy type checking: all arguments passed to .delay() will be checked against the original function signature
  • Graceful shutdown: waits until running tasks are finished

Installation

Darq uses aioredis 1.x as Redis client. Unfortunately, this library has been abandoned, and does not support Python 3.11. I made a fork with compatability fixes: evo-aioredis (https://github.com/evo-company/aioredis-py).

Because of this, aioredis is not currently added as Darq dependency, and you must install it yourself:

For Python<3.11 you can use:

pip install aioredis<2.0.0

For Python 3.11 (and older versions too) you can use fork:

pip install evo-aioredis<2.0.0

Quick start

And start worker:

python3 -m darq.cli -A some_project.darq_app.darq worker

Worker output:

15:24:42: Starting worker for 1 functions: some_project.darq_app.add_to_42
15:24:42: redis_version=5.0.7 mem_usage=834.87K clients_connected=1 db_keys=2
15:25:08:   0.22s → 1315f27608e9408392bf5d3310bca38c:darq_app.add_to_42(a=5)
15:25:08:   0.00s ← 1315f27608e9408392bf5d3310bca38c:darq_app.add_to_42 ● 47

About

Async task manager with Celery-like features. Fork of arq.

http://darq.readthedocs.io

License:MIT License


Languages

Language:Python 100.0%