GearmanClient::jobStatus

gearman_job_status

GearmanClient::jobStatus -- gearman_job_status — Get the status of a background job

说明

面向对象风格 (method):

publicarrayGearmanClient::jobStatus
( string$job_handle
)

Gets the status for a background job given a job handle. The status information will
specify whether the job is known, whether the job is currently running, and
the percentage completion.

参数

job_handle

由 Gearman 服务器指派的工作句柄。

返回值

An array containing status information for the job corresponding to the supplied
job handle. The first array element is a boolean indicating whether the job is
even known, the second is a boolean indicating whether the job is still running,
and the third and fourth elements correspond to the numerator and denominator
of the fractional completion percentage, respectively.

I believe to be correct. I read it as, if $stat[0] returns anything but false, the job is currently running, so we are not done. However, if we cannot find $stat[0] (ie: the job handle no longer exists) then the job is done.