* Also made some small doc fixes.
Change-Id: Id525bd7e14b49f0ed24530d7f94a8198ff7bf4d8
/**
* Class to both describe a background job and handle jobs.
/**
* Class to both describe a background job and handle jobs.
- * This queue aspects of this class are now deprecated.
+ * The queue aspects of this class are now deprecated.
* removed later on, when the first one is popped.
*
* @param $jobs array of Job objects
* removed later on, when the first one is popped.
*
* @param $jobs array of Job objects
*/
public static function batchInsert( $jobs ) {
return JobQueueGroup::singleton()->push( $jobs );
*/
public static function batchInsert( $jobs ) {
return JobQueueGroup::singleton()->push( $jobs );
* large batches of jobs can cause slave lag.
*
* @param $jobs array of Job objects
* large batches of jobs can cause slave lag.
*
* @param $jobs array of Job objects
*/
public static function safeBatchInsert( $jobs ) {
return JobQueueGroup::singleton()->push( $jobs, JobQueue::QoS_Atomic );
}
*/
public static function safeBatchInsert( $jobs ) {
return JobQueueGroup::singleton()->push( $jobs, JobQueue::QoS_Atomic );
}
+ /**
+ * 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 $type string
+ * @return Job
+ * @deprecated 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 or false if there's no jobs
+ * @deprecated 1.21
+ */
+ public static function pop() {
+ return JobQueueGroup::singleton()->pop();
+ }
+
/*-------------------------------------------------------------------------
* Non-static functions
*------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
* Non-static functions
*------------------------------------------------------------------------*/
/**
* Insert a single job into the queue.
* @return bool true on success
/**
* Insert a single job into the queue.
* @return bool true on success
*/
public function insert() {
return JobQueueGroup::singleton()->push( $this );
*/
public function insert() {
return JobQueueGroup::singleton()->push( $this );