* @ingroup JobQueue
*/
abstract class Job {
- /** @var int Job identifier */
- public $id;
-
/** @var string */
public $command;
* @param string $command Job command
* @param Title $title Associated title
* @param array|bool $params Job parameters
- * @param int $id Job identifier
* @throws MWException
* @return Job
*/
- public static function factory( $command, Title $title, $params = false, $id = 0 ) {
+ public static function factory( $command, Title $title, $params = false ) {
global $wgJobClasses;
if ( isset( $wgJobClasses[$command] ) ) {
$class = $wgJobClasses[$command];
- return new $class( $title, $params, $id );
+ return new $class( $title, $params );
}
throw new MWException( "Invalid job command `{$command}`" );
}
* @param $command
* @param $title
* @param $params array|bool
- * @param $id int
*/
- public function __construct( $command, $title, $params = false, $id = 0 ) {
+ public function __construct( $command, $title, $params = false ) {
$this->command = $command;
$this->title = $title;
$this->params = $params;
- $this->id = $id;
// expensive jobs may set this to true
$this->removeDuplicates = false;
}
- /**
- * @return int May be 0 for jobs stored outside the DB
- * @deprecated since 1.22
- */
- public function getId() {
- return $this->id;
- }
-
/**
* @return string
*/
/**
* @see JobQueue::deduplicateRootJob()
* @param string $key A key that identifies the task
- * @return array
+ * @return array Map of:
+ * - rootJobSignature : hash (e.g. SHA1) that identifies the task
+ * - rootJobTimestamp : TS_MW timestamp of this instance of the task
* @since 1.21
*/
public static function newRootJobParams( $key ) {