How can I get the status of non-blocking jobs of gearman submit_multiple_jobs?

284 views Asked by At

how can I tell if a background job or a non-blocking request by gearman client is successful or not?

while (True):
    jobs = getJobs()
    submitted_requests = gm_client.submit_multiple_jobs(jobs, background = False, wait_until_complete = False)
    # check status in a non-blocking mode
1

There are 1 answers

0
Gunjan On

You can refer to this link

here is the snippet

completed_requests = gm_client.wait_until_jobs_completed(submitted_requests, poll_timeout=5.0)
for completed_job_request in completed_requests:
    check_request_status(completed_job_request)  

check_request_status is defined in the link.