for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* PID tracker for the forked worker job.
*
* @package Resque/Job
* @author Chris Boulton <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php
*/
class Resque_Job_PID
{
* Create a new PID tracker item for the supplied job ID.
* @param string $id The ID of the job to track the PID of.
public static function create($id)
Resque::redis()->set('job:' . $id . ':pid', (string)getmypid());
set()
Resque_Redis
__call
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
Resque::redis()->/** @scrutinizer ignore-call */ set('job:' . $id . ':pid', (string)getmypid());
}
* Fetch the PID for the process actually executing the job.
* @param string $id The ID of the job to get the PID of.
* @return int PID of the process doing the job (on non-forking OS, PID of the worker, otherwise forked PID).
public static function get($id)
return (int)Resque::redis()->get('job:' . $id . ':pid');
get()
return (int)Resque::redis()->/** @scrutinizer ignore-call */ get('job:' . $id . ':pid');
* Remove the PID tracker for the job.
* @param string $id The ID of the job to remove the tracker from.
public static function del($id)
Resque::redis()->del('job:' . $id . ':pid');
del()
Resque::redis()->/** @scrutinizer ignore-call */ del('job:' . $id . ':pid');