* @ingroup JobQueue
*/
abstract class Job {
- /**
- * @var Title
- */
- var $title;
+ /** @var int Job identifier */
+ public $id;
- var $command,
- $params,
- $id,
- $removeDuplicates,
- $error;
+ /** @var string */
+ public $command;
- /** @var Array Additional queue metadata */
+ /** @var array|bool Array of job parameters or false if none */
+ public $params;
+
+ /** @var array Additional queue metadata */
public $metadata = array();
+ /** @var Title */
+ protected $title;
+
+ /** @var bool Expensive jobs may set this to true */
+ protected $removeDuplicates;
+
+ /** @var string Text for error that occurred last */
+ protected $error;
+
/*-------------------------------------------------------------------------
* Abstract functions
*------------------------------------------------------------------------*/
/**
* Run the job
- * @return boolean success
+ * @return bool Success
*/
abstract public function run();
* Create the appropriate object to handle a specific job
*
* @param string $command Job command
- * @param $title Title: Associated title
+ * @param Title $title Associated title
* @param array|bool $params Job parameters
* @param int $id Job identifier
* @throws MWException
* Pop a job off the front of the queue.
* This is subject to $wgJobTypesExcludedFromDefaultQueue.
*
- * @return Job or false if there's no jobs
+ * @return Job|bool False if there are no jobs
* @deprecated since 1.21
*/
public static function pop() {
$this->params = $params;
$this->id = $id;
- $this->removeDuplicates = false; // expensive jobs may set this to true
+ // expensive jobs may set this to true
+ $this->removeDuplicates = false;
}
/**
- * @return integer May be 0 for jobs stored outside the DB
+ * @return int May be 0 for jobs stored outside the DB
* @deprecated since 1.22
*/
public function getId() {
}
/**
- * @return integer|null UNIX timestamp to delay running this job until, otherwise null
+ * @return int|null UNIX timestamp to delay running this job until, otherwise null
* @since 1.22
*/
public function getReleaseTimestamp() {
* only checked if ignoreDuplicates() returns true, meaning that duplicate
* jobs are supposed to be ignored.
*
- * @return Array Map of key/values
+ * @return array Map of key/values
* @since 1.21
*/
public function getDeduplicationInfo() {
/**
* @see JobQueue::deduplicateRootJob()
* @param string $key A key that identifies the task
- * @return Array
+ * @return array
* @since 1.21
*/
public static function newRootJobParams( $key ) {
/**
* @see JobQueue::deduplicateRootJob()
- * @return Array
+ * @return array
* @since 1.21
*/
public function getRootJobParams() {