I am trying to figure out how to best setup the following scenario:
- Multiple A-type jobs are added into the queue
- When all A-type jobs are completed, a B or C-type job will be needed (one per A-type job)
- When all A, B and C type jobs are completed, a final D-type job will be needed
So basically we have some dependencies on jobs in the queue such that we don't want to start running jobs that require other jobs to be completed. Is there a guideline for setting up such a system? Should A-type jobs add B or C type jobs after their work is completed? Should all jobs be added up front and somehow tell the workers not to pull them until they are ready?
There are pros and cons of both approaches if I have to manually manage this dependency but I am curious if there is a different pattern I could use instead that might accomplish the same thing but in an easier way.