Chained celery tasks with delay

I am developer/code-reviewer/debugger/bug-fixer/architect/teacher/builder from dubai, uae
Search for a command to run...

I am developer/code-reviewer/debugger/bug-fixer/architect/teacher/builder from dubai, uae
No comments yet. Be the first to comment.
You Should Tell Yourself

A URL shortener is a proxy service that provides a mapping between the short and full representation of a URL. The short URL has the advantage of being small. The service can also provide useful analy

Listening to the Mel Robbins's podcast on regrets was a 'ear'-opener. One can have reqrets of action or inaction. 4 types of reqrets foundation - should've done the work boldness - should've taken t

We need to create a unique ID generator for our high-traffic web application, generating about 10K IDs/second. The IDs can't simply be monotonically increasing integers, which are good for data access
doing + telling

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