def get_task_to_run(self, tree):
"""Working from the bottom up, replace each node with a chain to its
descendant, or celery.Group of descendants.
:param tree: Dependancy graph of tasks
:type tree: networkx.DiGraph
:returns: chain to execute
"""
# TODO: This could be more parallel
return chain(*[
maybe_signature(tree.node[name]['task'], self.celery_app)
for name in nx.topological_sort(tree)
])
评论列表
文章目录