MediaWiki
REL1_20
|
Class to both describe a background job and handle jobs. More...
Public Member Functions | |
__construct ($command, $title, $params=false, $id=0) | |
getLastError () | |
insert () | |
Insert a single job into the queue. | |
removeDuplicates () | |
Remove jobs in the job queue which are duplicates of this job. | |
run () | |
Run the job. | |
toString () | |
Static Public Member Functions | |
static | batchInsert ($jobs) |
Batch-insert a group of jobs into the queue. | |
static | defaultQueueConditions () |
SQL conditions to apply on most JobQueue queries. | |
static | extractBlob ($blob) |
static | factory ($command, Title $title, $params=false, $id=0) |
Create the appropriate object to handle a specific job. | |
static | makeBlob ($params) |
static | pop ($offset=0) |
Pop a job off the front of the queue. | |
static | pop_type ($type) |
Pop a job of a certain type. | |
static | safeBatchInsert ($jobs) |
Insert a group of jobs into the queue. | |
Public Attributes | |
$command | |
$error | |
$id | |
$params | |
$removeDuplicates | |
Title | $title |
Protected Member Functions | |
insertFields () | |
setLastError ($error) |
Job::__construct | ( | $ | command, |
$ | title, | ||
$ | params = false , |
||
$ | id = 0 |
||
) |
static Job::batchInsert | ( | $ | jobs | ) | [static] |
Batch-insert a group of jobs into the queue.
This will be wrapped in a transaction with a forced commit.
This may add duplicate at insert time, but they will be removed later on, when the first one is popped.
$jobs | array of Job objects |
Definition at line 260 of file Job.php.
Referenced by DoubleRedirectJob\fixRedirects(), FixDoubleRedirects\queueJobs(), LinksUpdate\queueRecursiveJobs(), and RefreshLinksJob2\run().
static Job::defaultQueueConditions | ( | ) | [static] |
SQL conditions to apply on most JobQueue queries.
Whenever we exclude jobs types from the default queue, we want to make sure that queries to the job queue actually ignore them.
Definition at line 325 of file Job.php.
Referenced by nextJobDB\checkJob(), and RunJobs\execute().
static Job::extractBlob | ( | $ | blob | ) | [static] |
static Job::factory | ( | $ | command, |
Title $ | title, | ||
$ | params = false , |
||
$ | id = 0 |
||
) | [static] |
Create the appropriate object to handle a specific job.
$command | String: Job command |
$title | Title: Associated title |
$params | Array|bool: Job parameters |
$id | Int: Job identifier |
MWException |
Definition at line 218 of file Job.php.
Referenced by DoubleRedirectJob\run().
Job::insert | ( | ) |
Job::insertFields | ( | ) | [protected] |
static Job::makeBlob | ( | $ | params | ) | [static] |
static Job::pop | ( | $ | offset = 0 | ) | [static] |
Pop a job off the front of the queue.
$offset | Integer: Number of jobs to skip |
Definition at line 114 of file Job.php.
Referenced by UploadFromUrlTest\doAsyncUpload(), RunJobs\execute(), UploadFromUrlTest\testClearQueue(), UploadFromUrlTest\testLeaveMessage(), UploadFromUrlTest\testSetupUrlDownload(), and UploadFromUrlTest\testSyncDownload().
static Job::pop_type | ( | $ | type | ) | [static] |
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.
$type | string |
Definition at line 64 of file Job.php.
Referenced by RunJobs\execute().
Job::run | ( | ) | [abstract] |
Run the job.
Reimplemented in HTMLCacheUpdateJob, RefreshLinksJob2, DoubleRedirectJob, UploadFromUrlJob, RefreshLinksJob, EmaillingJob, and EnotifNotifyJob.
static Job::safeBatchInsert | ( | $ | jobs | ) | [static] |
Insert a group of jobs into the queue.
Same as batchInsert() but does not commit and can thus be rolled-back as part of a larger transaction. However, large batches of jobs can cause slave lag.
$jobs | array of Job objects |
Job::setLastError | ( | $ | error | ) | [protected] |
Job::toString | ( | ) |
Job::$error |
Definition at line 35 of file Job.php.
Referenced by setLastError().
Job::$id |
Definition at line 35 of file Job.php.
Referenced by EmaillingJob\__construct(), RefreshLinksJob\__construct(), EnotifNotifyJob\__construct(), UploadFromUrlJob\__construct(), DoubleRedirectJob\__construct(), and RefreshLinksJob2\__construct().
Job::$params |
Definition at line 35 of file Job.php.
Referenced by EmaillingJob\__construct(), RefreshLinksJob\__construct(), EnotifNotifyJob\__construct(), UploadFromUrlJob\__construct(), DoubleRedirectJob\__construct(), and RefreshLinksJob2\__construct().
Job::$removeDuplicates |
Title Job::$title |
Definition at line 33 of file Job.php.
Referenced by EnotifNotifyJob\__construct(), RefreshLinksJob\__construct(), UploadFromUrlJob\__construct(), DoubleRedirectJob\__construct(), RefreshLinksJob2\__construct(), DoubleRedirectJob\fixRedirects(), DoubleRedirectJob\getFinalDestination(), RefreshLinksJob2\run(), and RefreshLinksJob\runForTitleInternal().