consider following scenario;
There are 3 different type of tasks. A
, B
and C
. A
is meant to produce an input for B
and B
is supposed to create many C
tasks after receiving an input from A
.
At the start, i can only be able to define group(A, B)
as C
s are executed by B
. But i want to wait for all C
tasks to be finished as well in order to conclude that main task is done.
Is there a way of doing that by using celery utilities?
答案 0 :(得分:0)
我目前使用的解决方案是等待C
内的B
个任务。
喜欢的东西;
from celery.result import allow_join_result
def B():
tasks = get_c_tasks()
g = group(tasks)
gr = g.apply_async()
with allow_join_result():
return gr.join(propagate=False)