Sometimes I need to run task B after task A, but return the result of task A. Looking at the docs, I have tried to (Avoid launching synchronous subtasks)
So I would use a chain, like this:
@celery.task
def A():
return 5
@celery.task
def B():
return 2
def do_all():
chain = A.s() | B.s()
chain()
return result_of_A
But this would not work. In my case I need:
- B does not have any parameter. It does not accept the result of A
- B must be executed after A completes
- I do not need to wait for B to complete, and I do not need its result (B must be async?)
- How do I return the result of A in do_all? (A must be sync?)
Is it possible to implement this with chains or any other subtasks primitives?