I'm using Celery from a webapp to start a task hierarchy.
Tasks
I'm using the following tasks:
task_atask_btask_cnotify_user
A Django view starts several task_a instances. Each of them does some processing and then starts several task_b instances. And each of those does some processing and then starts several task_c instances.
To visualize:

Goals
My goal is to execute all the tasks, and to run a callback function as soon as the entire hierarchy has finished. Additionally, I want to be able to pass data from the lowest tasks to the top level.
- The view should just "kick off" the tasks and then return.
- Each subtask depends on the parent task. The parent task does not depend directly on the child task. After a parent task has started all the child tasks, it can be stopped.
- Everything can be parallelized, as long as the parent task runs before the child task is started.
- After all the tasks have finished, the
notify_usercallback function should be called. - The
notify_usercallback function needs access to data from thetask_cs.
All the tasks should be non-blocking, so task_b should not wait for all the task_c subtasks to finish.
What would be the right way to achieve the goal stated above?