}
/**
- * @return string One of (random, timestamp, fifo)
+ * @return string One of (random, timestamp, fifo, undefined)
*/
final public function getOrder() {
return $this->order;
}
/**
- * @return Array Subset of (random, timestamp, fifo)
+ * @return bool Whether delayed jobs are enabled
+ * @since 1.22
+ */
+ final public function delayedJobsEnabled() {
+ return $this->checkDelay;
+ }
+
+ /**
+ * Get the allowed queue orders for configuration validation
+ *
+ * @return Array Subset of (random, timestamp, fifo, undefined)
*/
abstract protected function supportedOrders();
/**
- * @return string One of (random, timestamp, fifo)
+ * Get the default queue order to use if configuration does not specify one
+ *
+ * @return string One of (random, timestamp, fifo, undefined)
*/
abstract protected function optimalOrder();
/**
+ * Find out if delayed jobs are supported for configuration validation
+ *
* @return boolean Whether delayed jobs are supported
*/
protected function supportsDelayedJobs() {
// Flag this job as an old duplicate based on its "root" job...
try {
if ( $job && $this->isRootJobOldDuplicate( $job ) ) {
- wfIncrStats( 'job-pop-duplicate' );
+ JobQueue::incrStats( 'job-pop-duplicate', $this->type );
$job = DuplicateJob::newFromJob( $job ); // convert to a no-op
}
} catch ( MWException $e ) {} // don't lose jobs over this
return new ArrayIterator( array() ); // not implemented
}
+ /**
+ * Call wfIncrStats() for the queue overall and for the queue type
+ *
+ * @param string $key Event type
+ * @param string $type Job type
+ * @param integer $delta
+ * @since 1.22
+ */
+ public static function incrStats( $key, $type, $delta = 1 ) {
+ wfIncrStats( $key, $delta );
+ wfIncrStats( "{$key}-{$type}", $delta );
+ }
+
/**
* Namespace the queue with a key to isolate it for testing
*