aboutsummaryrefslogtreecommitdiffstats
path: root/includes/jobqueue/Job.php
diff options
context:
space:
mode:
authorAaron Schulz <aschulz@wikimedia.org>2014-09-22 11:31:57 -0700
committerAaron Schulz <aschulz@wikimedia.org>2014-10-20 15:00:37 -0700
commitd695a8a5e476099038f629d21dde292a321091c5 (patch)
treec0fa3e1a50fe9211c7ed728c26724b54242724e6 /includes/jobqueue/Job.php
parentce8e466e44e773ca1b6dc72edd88a52ef17761e2 (diff)
downloadmediawikicore-d695a8a5e476099038f629d21dde292a321091c5.tar.gz
mediawikicore-d695a8a5e476099038f629d21dde292a321091c5.zip
Removed deprecated Job methods
Change-Id: Ib7a06ab19b31472c99cdccd418011beb6f075ca4
Diffstat (limited to 'includes/jobqueue/Job.php')
-rw-r--r--includes/jobqueue/Job.php81
1 files changed, 15 insertions, 66 deletions
diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php
index d89c5d29608e..1b401480b344 100644
--- a/includes/jobqueue/Job.php
+++ b/includes/jobqueue/Job.php
@@ -47,20 +47,12 @@ abstract class Job implements IJobSpecification {
/** @var string Text for error that occurred last */
protected $error;
- /*-------------------------------------------------------------------------
- * Abstract functions
- *------------------------------------------------------------------------*/
-
/**
* Run the job
* @return bool Success
*/
abstract public function run();
- /*-------------------------------------------------------------------------
- * Static functions
- *------------------------------------------------------------------------*/
-
/**
* Create the appropriate object to handle a specific job
*
@@ -81,6 +73,20 @@ abstract class Job implements IJobSpecification {
}
/**
+ * @param string $command
+ * @param Title $title
+ * @param array|bool $params Can not be === true
+ */
+ public function __construct( $command, $title, $params = false ) {
+ $this->command = $command;
+ $this->title = $title;
+ $this->params = $params;
+
+ // expensive jobs may set this to true
+ $this->removeDuplicates = false;
+ }
+
+ /**
* Batch-insert a group of jobs into the queue.
* This will be wrapped in a transaction with a forced commit.
*
@@ -92,69 +98,12 @@ abstract class Job implements IJobSpecification {
* @deprecated since 1.21
*/
public static function batchInsert( $jobs ) {
+ wfDeprecated( __METHOD__, '1.21' );
JobQueueGroup::singleton()->push( $jobs );
return true;
}
/**
- * Insert a group of jobs into the queue.
- *
- * Same as batchInsert() but does not commit and can thus
- * be rolled-back as part of a larger transaction. However,
- * large batches of jobs can cause slave lag.
- *
- * @param Job[] $jobs Array of Job objects
- * @return bool
- * @deprecated since 1.21
- */
- public static function safeBatchInsert( $jobs ) {
- JobQueueGroup::singleton()->push( $jobs, JobQueue::QOS_ATOMIC );
- return true;
- }
-
- /**
- * Pop a job of a certain type. This tries less hard than pop() to
- * actually find a job; it may be adversely affected by concurrent job
- * runners.
- *
- * @param string $type
- * @return Job|bool Returns false if there are no jobs
- * @deprecated since 1.21
- */
- public static function pop_type( $type ) {
- return JobQueueGroup::singleton()->get( $type )->pop();
- }
-
- /**
- * Pop a job off the front of the queue.
- * This is subject to $wgJobTypesExcludedFromDefaultQueue.
- *
- * @return Job|bool False if there are no jobs
- * @deprecated since 1.21
- */
- public static function pop() {
- return JobQueueGroup::singleton()->pop();
- }
-
- /*-------------------------------------------------------------------------
- * Non-static functions
- *------------------------------------------------------------------------*/
-
- /**
- * @param string $command
- * @param Title $title
- * @param array|bool $params Can not be === true
- */
- public function __construct( $command, $title, $params = false ) {
- $this->command = $command;
- $this->title = $title;
- $this->params = $params;
-
- // expensive jobs may set this to true
- $this->removeDuplicates = false;
- }
-
- /**
* @return string
*/
public function getType() {