public function setMaxQueueSize($function, $size)
    {
        if (!is_numeric($size)) {
            throw new Exception('Queue size must be numeric');
        }

        if (preg_match('/[^a-z0-9_]/i', $function)) {
            throw new Exception('Invalid function name');
        }

        $this->sendCommand('maxqueue ' . $function . ' ' . $size);
        $res = fgets($this->conn, 4096);
        $this->checkForError($res);

        return (trim($res) == 'OK');
    }
public function setMaxQueueSize($function, $size)
    {
        if (!is_numeric($size)) {
            throw new Exception('Queue size must be numeric');
        }

        if (preg_match('/[^a-z0-9_]/i', $function)) {
            throw new Exception('Invalid function name');
        }

        $this->sendCommand('maxqueue ' . $function . ' ' . $size);
        $res = fgets($this->conn, 4096);
        $this->checkForError($res);

        return (trim($res) == 'OK');
    }
public function setMaxQueueSize ( $ function , $ size ) { if ( ! is_numeric ( $ size ) ) { throw new Exception ( 'Queue size must be numeric' ) ; } if ( preg_match ( '/[^a-z0-9_]/i' , $ function ) ) { throw new Exception ( 'Invalid function name' ) ; } $ this -> sendCommand ( 'maxqueue ' . $ function . ' ' . $ size ) ; $ res = fgets ( $ this -> conn , 4096 ) ; $ this -> checkForError ( $ res ) ; return ( trim ( $ res ) == 'OK' ) ; }
Set maximum queue size for a function.

For a given function of job, the maximum queue size is adjusted to be
max_queue_size jobs long. A negative value indicates unlimited queue
size.

If the max_queue_size value is not supplied then it is unset (and the
default maximum queue size will apply to this function).

@param string $function Name of function to set queue size for
@param int    $size     New size of queue

@throws \MHlavac\Gearman\Exception

@return bool
Set maximum queue size for a function .