1

I'm running the following chord in my periodic task:

(group(task_A1, task_A2, ... , task_An) | task_B)

Each of tasks (task_A1, task_A2 ... , task_An) may take ~5-10 min to run.

Consider the following scenario: During a periodic task (hourly),task_A1 .. task_An are running in parallel. Now, from another flow someone triggered an external task_A1' task. My goal is to stop & replace only the current running task_A1 with task_A1' and keep (without stopping task_A2.. task_An) the flow as is - which is to wait for the group (of task_A2, ... ,task_An & the new task_A1') to finish and to start the task_B.

My current solution is to revoke task_A1 & task_B and add new tasks task_A1' & task_B' to queues - but I wonder how to be create this new combination with the already running task_A2, ... , task_An, to achieve something like:

(group(task_A1', task_A2, ... , task_An) | task_B')

I'm doing that by revoking tasks and "rewire" them in CeleryRouter. I'm pulling the tasks from celeryapp.control.inspect().active() and celeryapp.control.inspect().reserved(). I wonder if there is elegant way to get my goal.

Thanks.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.