Celery worker for running asyncio coroutine tasks
Project description
AsyncIO Celery Worker
Overview
This project is an alternative asyncio implementation of the Celery Worker protocol.
- Feature parity with upstream Celery project IS NOT the goal
- Support of different brokers/result backends IS NOT the goal
The following are the actual goals:
- The code base of this project must be as simple as possible to understand and reason about
- There should be as little code as possible (less code means less bugs)
- There should be as little external dependencies as possible
- This project must not have celery as an external dependency
Usage
import asyncio
from aio_celery import Celery
app = Celery()
@app.task(name='add-two-numbers')
async def mul(a, b):
await asyncio.sleep(5)
return a + b
Then run worker:
$ aio_celery -A hello:app worker --concurrency=50000
$ aio_celery worker hello:app
Queue some tasks:
import asyncio
from hello import add, app
async def fill_queue():
async with app.setup():
for n in range(50000):
await add.delay(n, n)
asyncio.run(fill_queue())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aio-celery-0.1.0.tar.gz
(9.7 kB
view hashes)
Built Distribution
aio_celery-0.1.0-py3-none-any.whl
(11.6 kB
view hashes)
Close
Hashes for aio_celery-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f9203e0052a968cd38e4b6bb8f33274773098a485af88ef0965860b51d4edb6 |
|
MD5 | 737ba91c4f0d71f099dcebee008c454c |
|
BLAKE2b-256 | d639ff40b93a8ab101406b79400702db3d584cb0fcd08c68d60783620a23a4f4 |