If this is an idiotic question, I apologize and will hide my head from shame, but:
I use rq to queue in Python. I want it to work as follows:
- Job A starts. Job A captures data through the web API and saves it.
- Work in progress A.
- Task A is completed.
- Upon completion of A, work B starts. Task B checks each record stored in task A and adds some additional response data.
- Upon completion of task B, the user receives a happy letter stating that the report is ready.
My code is:
redis_conn = Redis() use_connection(redis_conn) q = Queue('normal', connection=redis_conn) # this is terrible, I know - fixing later w = Worker(q) job = q.enqueue(getlinksmod.lsGet, theURL,total,domainid) w.work()
I suggested that my best solution is to have 2 workers, one for job A and one for B. Job B worker could control job A and, when job A was completed, start job B.
What I cannot understand in order to save my life is how I force one employee to control the status of another. I can get the job id from job A with job.id. I can capture the name of the worker using w.name. But I have nothing stupid, how to transfer any of this information to another employee.
Or, is there a much simpler way to do this that I am completely missing?
source share