|
GearmanClient::doBackgroundRun a task in the background 説明
public string GearmanClient::doBackground(string
$function , string $workload , stringnull $unique = null )Runs a task in the background, returning a job handle which can be used to get the status of the running task. パラメータ
戻り値The job handle for the submitted task. 例
例1 Submit and monitor a background job The worker in this example has an artificial delay introduced to mimic a long running job. The client script periodically checks the status of the running job.
上の例の出力は、 たとえば以下のようになります。 Running: true, numerator: 3, denominator: 14 Running: true, numerator: 6, denominator: 14 Running: true, numerator: 9, denominator: 14 Running: true, numerator: 12, denominator: 14 Running: false, numerator: 0, denominator: 0 done! 参考
|