Leverage Celery Chains to execute sequential tasks. But it wasn't clear from the documentation on how to add a delay in-between executions.
The initial (reasonable) attempt:
result = (
add.s(1,1) |
mul.s(3) |
mul.s(4)
).apply_async(countdown=5) # 24
resulted in the task completing immediately.
However setting the countdown
for each signature* worked.
result = (
add.s(1,1) |
mul.s(3).set(countdown=5) |
mul.s(4).set(countdown=5)
) # 24
*use immutable signatures (shortcut: si) so the next task doesn't require the return value of the previous one who's result is implicitly passed as the first argument