Skip to main content

Celery Canvas

Chains

  • tasks can be linked together: the linked task is called when the task returns successfully
  • example:
from celery import chain
from task import task_a, task_b, task_c

work_flow = chain(task_a(arg1, arg2), task_b(result, arg4, arg5), task_c(arg6, arg7))

# another way

s = task_a.s(arg1, arg2)
s.link(task_b.s(arg4, arg5))

# another way using pipes
work_flow = task_a(arg1, arg2) | task_b(result, arg4) | task_c(arg5, arg6)