Resque_Worker::workerPids PHP Method

workerPids() public method

Return an array of process IDs for all of the Resque workers currently running on this machine.
public workerPids ( ) : array
return array Array of Resque worker process IDs.
    public function workerPids()
    {
        $pids = array();
        exec('ps -A -o pid,command | grep [r]esque', $cmdOutput);
        foreach ($cmdOutput as $line) {
            list($pids[], ) = explode(' ', trim($line), 2);
        }
        return $pids;
    }