I have two celery tasks task1 and task2 which write to database. The third task task3 reads from the same database. task1 and task2 can run in parallel. task3 will run after both task1 and task2 have run.
I have looked at groups, chains and chords but can't get around to a place where I can run task3 without passing the arguments of task1 and task2 to it. I just want the sequence to be maintained
Any help in this direction is highly appreciated. Basically to run xsquare task at the last
@app.task
def xsum():
return sum(i + i for i in range(100))
@app.task
def xmult():
return sum(i * i for i in range(100))
@app.task
def xsquare():
return sum(i * i for i in range(100))
xsum_mult = group(xsum.s(), xmult.s())
xsum_mult.apply_async()
# now run xsquare task