MediaWiki
REL1_24
|
Class to handle enqueueing of background jobs. More...
Public Member Functions | |
ack (Job $job) | |
Acknowledge that a job was completed. | |
deduplicateRootJob (Job $job) | |
Register the "root job" of a given job into the queue for de-duplication. | |
executeReadyPeriodicTasks () | |
Execute any due periodic queue maintenance tasks for all queues. | |
get ($type) | |
Get the job queue object for a given queue type. | |
getDefaultQueueTypes () | |
Get the list of default queue types. | |
getQueueSizes () | |
Get the size of the queus for a list of job types. | |
getQueuesWithJobs () | |
Get the list of job types that have non-empty queues. | |
getQueueTypes () | |
Get the list of queue types. | |
pop ($qtype=self::TYPE_DEFAULT, $flags=0, array $blacklist=array()) | |
Pop a job off one of the job queues. | |
push ($jobs) | |
Insert jobs into the respective queues of with the belong. | |
queuesHaveJobs ($type=self::TYPE_ANY) | |
Check if there are any queues with jobs (this is cached) | |
waitForBackups () | |
Wait for any slaves or backup queue servers to catch up. | |
Static Public Member Functions | |
static | destroySingletons () |
Destroy the singleton instances. | |
static | singleton ($wiki=false) |
Public Attributes | |
const | CACHE_VERSION = 1 |
const | PROC_CACHE_TTL = 15 |
const | TYPE_ANY = 2 |
const | TYPE_DEFAULT = 1 |
const | USE_CACHE = 1 |
Protected Member Functions | |
__construct ($wiki) | |
getCoalescedQueues () | |
Protected Attributes | |
ProcessCacheLRU | $cache |
* | |
array | $coalescedQueues |
Map of (bucket => (queue => JobQueue, types => list of types) *. | |
string | $wiki |
Wiki ID *. | |
Static Protected Attributes | |
static | $instances = array() |
Private Member Functions | |
getCachedConfigVar ($name) |
Class to handle enqueueing of background jobs.
Definition at line 30 of file JobQueueGroup.php.
JobQueueGroup::__construct | ( | $ | wiki | ) | [protected] |
string | $wiki | Wiki ID |
Definition at line 52 of file JobQueueGroup.php.
JobQueueGroup::ack | ( | Job $ | job | ) |
Acknowledge that a job was completed.
Job | $job |
Definition at line 194 of file JobQueueGroup.php.
JobQueueGroup::deduplicateRootJob | ( | Job $ | job | ) |
Register the "root job" of a given job into the queue for de-duplication.
This should only be called right *after* all the new jobs have been inserted.
Job | $job |
Definition at line 205 of file JobQueueGroup.php.
static JobQueueGroup::destroySingletons | ( | ) | [static] |
Destroy the singleton instances.
Definition at line 75 of file JobQueueGroup.php.
Referenced by TemplateCategoriesTest\testTemplateCategories().
Execute any due periodic queue maintenance tasks for all queues.
A task is "due" if the time ellapsed since the last run is greater than the defined run period. Concurrent calls to this function will cause tasks to be attempted twice, so they may need their own methods of mutual exclusion.
Definition at line 356 of file JobQueueGroup.php.
JobQueueGroup::get | ( | $ | type | ) |
Get the job queue object for a given queue type.
string | $type |
Definition at line 85 of file JobQueueGroup.php.
JobQueueGroup::getCachedConfigVar | ( | $ | name | ) | [private] |
JobQueueGroup::getCoalescedQueues | ( | ) | [protected] |
Definition at line 320 of file JobQueueGroup.php.
Get the list of default queue types.
Definition at line 242 of file JobQueueGroup.php.
Get the size of the queus for a list of job types.
Definition at line 301 of file JobQueueGroup.php.
Get the list of job types that have non-empty queues.
Definition at line 278 of file JobQueueGroup.php.
Get the list of queue types.
Definition at line 233 of file JobQueueGroup.php.
JobQueueGroup::pop | ( | $ | qtype = self::TYPE_DEFAULT , |
$ | flags = 0 , |
||
array $ | blacklist = array() |
||
) |
Pop a job off one of the job queues.
This pops a job off a queue as specified by $wgJobTypeConf and updates the aggregate job queue information cache as needed.
int | string | $qtype | JobQueueGroup::TYPE_* constant or job type string |
int | $flags | Bitfield of JobQueueGroup::USE_* constants |
array | $blacklist | List of job types to ignore |
Definition at line 147 of file JobQueueGroup.php.
JobQueueGroup::push | ( | $ | jobs | ) |
Insert jobs into the respective queues of with the belong.
This inserts the jobs into the queue specified by $wgJobTypeConf and updates the aggregate job queue information cache as needed.
MWException |
Definition at line 108 of file JobQueueGroup.php.
JobQueueGroup::queuesHaveJobs | ( | $ | type = self::TYPE_ANY | ) |
Check if there are any queues with jobs (this is cached)
int | $type | JobQueueGroup::TYPE_* constant |
Definition at line 255 of file JobQueueGroup.php.
static JobQueueGroup::singleton | ( | $ | wiki = false | ) | [static] |
bool | string | $wiki | Wiki ID |
Definition at line 61 of file JobQueueGroup.php.
Referenced by UploadFromUrlTest\doAsyncUpload(), CopyJobQueue\execute(), ShowJobs\execute(), JobQueueAggregator\findPendingWikiQueues(), Job\insert(), UploadFromUrl\insertJob(), SiteStats\jobs(), FixDoubleRedirects\queueJobs(), RefreshLinksJob2\run(), HTMLCacheUpdateJob\run(), RefreshLinksJob\run(), NullJob\run(), UploadFromUrlTest\testClearQueue(), UploadFromUrlTest\testLeaveMessage(), UploadFromUrlTest\testSetupUrlDownload(), and UploadFromUrlTest\testSyncDownload().
Wait for any slaves or backup queue servers to catch up.
This does nothing for certain queue classes.
MWException |
Definition at line 217 of file JobQueueGroup.php.
ProcessCacheLRU JobQueueGroup::$cache [protected] |
*
Definition at line 34 of file JobQueueGroup.php.
array JobQueueGroup::$coalescedQueues [protected] |
Map of (bucket => (queue => JobQueue, types => list of types) *.
Definition at line 38 of file JobQueueGroup.php.
JobQueueGroup::$instances = array() [static, protected] |
Definition at line 32 of file JobQueueGroup.php.
string JobQueueGroup::$wiki [protected] |
Wiki ID *.
Definition at line 36 of file JobQueueGroup.php.
const JobQueueGroup::CACHE_VERSION = 1 |
Definition at line 47 of file JobQueueGroup.php.
const JobQueueGroup::PROC_CACHE_TTL = 15 |
Definition at line 45 of file JobQueueGroup.php.
const JobQueueGroup::TYPE_ANY = 2 |
Definition at line 41 of file JobQueueGroup.php.
const JobQueueGroup::TYPE_DEFAULT = 1 |
Definition at line 40 of file JobQueueGroup.php.
const JobQueueGroup::USE_CACHE = 1 |
Definition at line 43 of file JobQueueGroup.php.