[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/jobqueue/ -> JobQueueGroup.php (summary)

Job queue base code. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Author: Aaron Schulz
File Size: 440 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JobQueueGroup:: (17 methods):
  __construct()
  singleton()
  destroySingletons()
  get()
  push()
  pop()
  ack()
  deduplicateRootJob()
  waitForBackups()
  getQueueTypes()
  getDefaultQueueTypes()
  queuesHaveJobs()
  getQueuesWithJobs()
  getQueueSizes()
  getCoalescedQueues()
  executeReadyPeriodicTasks()
  getCachedConfigVar()


Class: JobQueueGroup  - X-Ref

Class to handle enqueueing of background jobs

__construct( $wiki )   X-Ref

param: string $wiki Wiki ID

singleton( $wiki = false )   X-Ref

param: bool|string $wiki Wiki ID
return: JobQueueGroup

destroySingletons()   X-Ref
Destroy the singleton instances

return: void

get( $type )   X-Ref
Get the job queue object for a given queue type

param: string $type
return: JobQueue

push( $jobs )   X-Ref
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.

param: Job|array $jobs A single Job or a list of Jobs
return: void

pop( $qtype = self::TYPE_DEFAULT, $flags = 0, array $blacklist = array()   X-Ref
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.

param: int|string $qtype JobQueueGroup::TYPE_* constant or job type string
param: int $flags Bitfield of JobQueueGroup::USE_* constants
param: array $blacklist List of job types to ignore
return: Job|bool Returns false on failure

ack( Job $job )   X-Ref
Acknowledge that a job was completed

param: Job $job
return: bool

deduplicateRootJob( Job $job )   X-Ref
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.

param: Job $job
return: bool

waitForBackups()   X-Ref
Wait for any slaves or backup queue servers to catch up.

This does nothing for certain queue classes.

return: void

getQueueTypes()   X-Ref
Get the list of queue types

return: array List of strings

getDefaultQueueTypes()   X-Ref
Get the list of default queue types

return: array List of strings

queuesHaveJobs( $type = self::TYPE_ANY )   X-Ref
Check if there are any queues with jobs (this is cached)

param: int $type JobQueueGroup::TYPE_* constant
return: bool

getQueuesWithJobs()   X-Ref
Get the list of job types that have non-empty queues

return: array List of job types that have non-empty queues

getQueueSizes()   X-Ref
Get the size of the queus for a list of job types

return: array Map of (job type => size)

getCoalescedQueues()   X-Ref

return: array

executeReadyPeriodicTasks()   X-Ref
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.

return: int Number of tasks run

getCachedConfigVar( $name )   X-Ref

param: string $name
return: mixed



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1