MediaWiki
REL1_21
|
Class to both describe a background job and handle jobs. More...
Public Member Functions | |
__construct ($command, $title, $params=false, $id=0) | |
allowRetries () | |
getDeduplicationInfo () | |
Subclasses may need to override this to make duplication detection work. | |
getId () | |
getLastError () | |
getParams () | |
getRootJobParams () | |
getTitle () | |
getType () | |
ignoreDuplicates () | |
insert () | |
Insert a single job into the queue. | |
run () | |
Run the job. | |
toString () | |
Static Public Member Functions | |
static | batchInsert ($jobs) |
Batch-insert a group of jobs into the queue. | |
static | factory ($command, Title $title, $params=false, $id=0) |
Create the appropriate object to handle a specific job. | |
static | newRootJobParams ($key) |
static | pop () |
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 | |
Array | $metadata = array() |
Additional queue metadata *. | |
$params | |
$removeDuplicates | |
Title | $title |
Protected Member Functions | |
setLastError ($error) |
Class to both describe a background job and handle jobs.
The queue aspects of this class are now deprecated.
Job::__construct | ( | $ | command, |
$ | title, | ||
$ | params = false , |
||
$ | id = 0 |
||
) |
Reimplemented in PublishStashedFileJob, and AssembleUploadChunksJob.
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.
array | $jobs | of Job objects |
static Job::factory | ( | $ | command, |
Title $ | title, | ||
$ | params = false , |
||
$ | id = 0 |
||
) | [static] |
Create the appropriate object to handle a specific job.
string | $command | Job command |
$title | Title: Associated title | |
array | bool | $params | Job parameters |
int | $id | Job identifier |
MWException |
Definition at line 67 of file Job.php.
Referenced by DoubleRedirectJob\run().
Subclasses may need to override this to make duplication detection work.
Reimplemented in RefreshLinksJob2, PublishStashedFileJob, AssembleUploadChunksJob, and RefreshLinksJob.
Definition at line 196 of file Job.php.
Referenced by JobQueueDB\insertFields().
Job::getId | ( | ) |
Definition at line 152 of file Job.php.
Referenced by JobQueueDB\doAck(), and DuplicateJob\newFromJob().
Job::getParams | ( | ) |
Definition at line 173 of file Job.php.
Referenced by JobQueueDB\doDeduplicateRootJob(), JobQueueDB\insertFields(), JobQueueDB\isRootJobOldDuplicate(), and DuplicateJob\newFromJob().
Definition at line 225 of file Job.php.
Referenced by RefreshLinksJob2\getSingleTitleJobs(), and RefreshLinksJob2\run().
Job::getTitle | ( | ) |
Definition at line 166 of file Job.php.
Referenced by JobQueueDB\insertFields(), and DuplicateJob\newFromJob().
Job::getType | ( | ) |
Definition at line 159 of file Job.php.
Referenced by JobQueue\ack(), JobQueue\deduplicateRootJob(), JobQueueDB\insertFields(), and DuplicateJob\newFromJob().
Job::insert | ( | ) |
static Job::newRootJobParams | ( | $ | key | ) | [static] |
string | $key | A key that identifies the task |
Definition at line 215 of file Job.php.
Referenced by HTMLCacheUpdate\doUpdate(), LinksUpdate\queueRecursiveJobs(), and JobQueueTest\testRootDeduplication().
static Job::pop | ( | ) | [static] |
Pop a job off the front of the queue.
This is subject to $wgJobTypesExcludedFromDefaultQueue.
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 |
Job::run | ( | ) | [abstract] |
Run the job.
Reimplemented in RefreshLinksJob2, DoubleRedirectJob, HTMLCacheUpdateJob, DuplicateJob, NullJob, UploadFromUrlJob, RefreshLinksJob, AssembleUploadChunksJob, EmaillingJob, EnotifNotifyJob, and PublishStashedFileJob.
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.
array | $jobs | of Job objects |
Job::setLastError | ( | $ | error | ) | [protected] |
Definition at line 280 of file Job.php.
Referenced by AssembleUploadChunksJob\run(), PublishStashedFileJob\run(), and DoubleRedirectJob\run().
Job::toString | ( | ) |
Job::$id |
Definition at line 35 of file Job.php.
Referenced by AssembleUploadChunksJob\__construct(), RefreshLinksJob\__construct(), PublishStashedFileJob\__construct(), EmaillingJob\__construct(), EnotifNotifyJob\__construct(), DuplicateJob\__construct(), NullJob\__construct(), UploadFromUrlJob\__construct(), DoubleRedirectJob\__construct(), and RefreshLinksJob2\__construct().
Job::$params |
Definition at line 35 of file Job.php.
Referenced by AssembleUploadChunksJob\__construct(), PublishStashedFileJob\__construct(), RefreshLinksJob\__construct(), EmaillingJob\__construct(), EnotifNotifyJob\__construct(), DuplicateJob\__construct(), NullJob\__construct(), UploadFromUrlJob\__construct(), DoubleRedirectJob\__construct(), RefreshLinksJob2\__construct(), and NullJob\run().
Definition at line 33 of file Job.php.
Referenced by AssembleUploadChunksJob\__construct(), PublishStashedFileJob\__construct(), RefreshLinksJob\__construct(), EnotifNotifyJob\__construct(), DuplicateJob\__construct(), NullJob\__construct(), UploadFromUrlJob\__construct(), DoubleRedirectJob\__construct(), RefreshLinksJob2\__construct(), DoubleRedirectJob\fixRedirects(), DoubleRedirectJob\getFinalDestination(), and RefreshLinksJob2\getSingleTitleJobs().