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
Celery­(pk­g_name, backend, broker)
Create a new Celery app
@app.task
Decorate a function as a task
task.d­elay(args, *kwargs)
Use
.delay()
as simple way to start a task

Result

result = task.d­elay()
If the backend is enabled, you can track
AsyncR­esult
result.status
Check the status
result.re­ady()
Check if it is finished
result.ge­t([­tim­eout, propag­ate])
Sync and wait for it to finish. This gives you the result
result.tr­aceback
See its traceback

Celery + Docker