I\'m writing an application which needs to run a series of tasks in parallel and then a single task with the results of all the tasks run:
@celery.task
def p
Taking a look at this snippet from your question, it looks like you are passing a list
as the chord header, rather than a group
:
from time import sleep
import random
tasks = []
for i in xrange(10):
tasks.append(power.s((i, 2)))
sleep(random.randint(10, 1000) / 1000.0) # sleep for 10-1000ms
callback = amass.s()
r = chord(tasks)(callback)
Converting the list
to a group
should result in the behaviour you're expecting:
...
callback = amass.s()
tasks = group(tasks)
r = chord(tasks)(callback)