doNotifyQueueEmpty( $wiki, $type ); wfProfileOut( __METHOD__ ); return $ok; } /** * @see JobQueueAggregator::notifyQueueEmpty() */ abstract protected function doNotifyQueueEmpty( $wiki, $type ); /** * Mark a queue as being non-empty * * @param string $wiki * @param string $type * @return bool Success */ final public function notifyQueueNonEmpty( $wiki, $type ) { wfProfileIn( __METHOD__ ); $ok = $this->doNotifyQueueNonEmpty( $wiki, $type ); wfProfileOut( __METHOD__ ); return $ok; } /** * @see JobQueueAggregator::notifyQueueNonEmpty() */ abstract protected function doNotifyQueueNonEmpty( $wiki, $type ); /** * Get the list of all of the queues with jobs * * @return Array (job type => (list of wiki IDs)) */ final public function getAllReadyWikiQueues() { wfProfileIn( __METHOD__ ); $res = $this->doGetAllReadyWikiQueues(); wfProfileOut( __METHOD__ ); return $res; } /** * @see JobQueueAggregator::getAllReadyWikiQueues() */ abstract protected function doGetAllReadyWikiQueues(); /** * Get all databases that have a pending job. * This poll all the queues and is this expensive. * * @return Array (job type => (list of wiki IDs)) */ protected function findPendingWikiQueues() { global $wgLocalDatabases; $pendingDBs = array(); // (job type => (db list)) foreach ( $wgLocalDatabases as $db ) { foreach ( JobQueueGroup::singleton( $db )->getQueuesWithJobs() as $type ) { $pendingDBs[$type][] = $db; } } return $pendingDBs; } }