original_string: 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');
      }
code: 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');
      }
code_tokens: 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' ) ; }
docstring: 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
docstring_tokens: Set maximum queue size for a function .