如何获取gearman submit_multiple_jobs的非阻塞作业的状态?

时间:2013-08-09 08:00:07

标签: nonblocking gearman python-gearman

如何判断gearman客户端的后台作业或非阻塞请求是否成功?

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 个答案:

答案 0 :(得分:0)

您可以参考this link

这是片段

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在链接中定义。