Show Menu
Cheatography

Celery Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Python Celery

from celery import Celery
Celer­y(p­kg_­name, backend, broker)
Create a new Celery app
@app.t­ask
Decorate a function as a task
task.d­el­ay(­args, *kwargs)
Use .delay() as simple way to start a task

Result

result = task.d­elay()
If the backend is enabled, you can track Async­Result
resul­t.s­tatus
Check the status
resul­t.r­eady()
Check if it is finished
resul­t.g­et(­[ti­meout, propag­ate])
Sync and wait for it to finish. This gives you the result
resul­t.t­rac­eback
See its traceback

Celery + Docker