MediaWiki
REL1_24
|
Class to both describe a background job and handle jobs. More...
Public Member Functions | |
__construct ($command, $title, $params=false) | |
allowRetries () | |
getDeduplicationInfo () | |
Subclasses may need to override this to make duplication detection work. | |
getLastError () | |
getParams () | |
getReleaseTimestamp () | |
getRootJobParams () | |
getTitle () | |
getType () | |
hasRootJobParams () | |
ignoreDuplicates () | |
insert () | |
Insert a single job into the queue. | |
run () | |
Run the job. | |
toString () | |
workItemCount () | |
Static Public Member Functions | |
static | batchInsert ($jobs) |
Batch-insert a group of jobs into the queue. | |
static | factory ($command, Title $title, $params=false) |
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 | |
string | $command |
* | |
array | $metadata = array() |
Additional queue metadata *. | |
array bool | $params |
Array of job parameters or false if none *. | |
Protected Member Functions | |
setLastError ($error) | |
Protected Attributes | |
string | $error |
Text for error that occurred last *. | |
bool | $removeDuplicates |
Expensive jobs may set this to true *. | |
Title | $title |
* |
Class to both describe a background job and handle jobs.
The queue aspects of this class are now deprecated. Using the class to push jobs onto queues is deprecated (use JobSpecification).
Job::__construct | ( | $ | command, |
$ | title, | ||
$ | params = false |
||
) |
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 | Array of Job objects |
static Job::factory | ( | $ | command, |
Title $ | title, | ||
$ | params = false |
||
) | [static] |
Create the appropriate object to handle a specific job.
MWException |
Definition at line 67 of file Job.php.
Referenced by RefreshLinksJob\runForTitle().
Subclasses may need to override this to make duplication detection work.
The resulting map conveys everything that makes the job unique. This is only checked if ignoreDuplicates() returns true, meaning that duplicate jobs are supposed to be ignored.
Implements IJobSpecification.
Reimplemented in RefreshLinksJob, PublishStashedFileJob, RefreshLinksJob2, and AssembleUploadChunksJob.
Job::getParams | ( | ) |
Implements IJobSpecification.
Definition at line 168 of file Job.php.
Referenced by DuplicateJob\newFromJob(), and BacklinkJobUtils\partitionBacklinkJob().
Implements IJobSpecification.
Definition at line 253 of file Job.php.
References array().
Referenced by JobQueue\doDeduplicateRootJob(), RefreshLinksJob2\getSingleTitleJobs(), RefreshLinksJob2\run(), HTMLCacheUpdateJob\run(), and RefreshLinksJob\run().
Job::getTitle | ( | ) |
Implements IJobSpecification.
Definition at line 161 of file Job.php.
Referenced by DuplicateJob\newFromJob(), and BacklinkJobUtils\partitionBacklinkJob().
Job::getType | ( | ) |
Implements IJobSpecification.
Definition at line 154 of file Job.php.
Referenced by DuplicateJob\newFromJob().
Definition at line 269 of file Job.php.
Referenced by JobQueue\doDeduplicateRootJob().
Implements IJobSpecification.
Job::insert | ( | ) |
Insert a single job into the queue.
Definition at line 279 of file Job.php.
References JobQueueGroup\singleton().
static Job::newRootJobParams | ( | $ | key | ) | [static] |
string | $key | A key that identifies the task |
Definition at line 241 of file Job.php.
Referenced by RefreshLinksPartitionTest\testRefreshLinks(), 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.
string | $type |
Job::run | ( | ) | [abstract] |
Run the job.
Reimplemented in DoubleRedirectJob, NullJob, RefreshLinksJob, DuplicateJob, UploadFromUrlJob, HTMLCacheUpdateJob, RefreshLinksJob2, AssembleUploadChunksJob, EmaillingJob, PublishStashedFileJob, 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.
array | $jobs | Array of Job objects |
Job::setLastError | ( | $ | error | ) | [protected] |
Definition at line 337 of file Job.php.
Referenced by AssembleUploadChunksJob\run(), PublishStashedFileJob\run(), and RefreshLinksJob\runForTitle().
Job::toString | ( | ) |
Reimplemented in RefreshLinksJob, and HTMLCacheUpdateJob.
string Job::$command |
string Job::$error [protected] |
array bool Job::$params |
Array of job parameters or false if none *.
Definition at line 34 of file Job.php.
Referenced by AssembleUploadChunksJob\__construct(), EnotifNotifyJob\__construct(), PublishStashedFileJob\__construct(), EmaillingJob\__construct(), RefreshLinksJob2\__construct(), DuplicateJob\__construct(), HTMLCacheUpdateJob\__construct(), UploadFromUrlJob\__construct(), RefreshLinksJob\__construct(), NullJob\__construct(), __construct(), and NullJob\run().
bool Job::$removeDuplicates [protected] |
*
Definition at line 38 of file Job.php.
Referenced by AssembleUploadChunksJob\__construct(), EnotifNotifyJob\__construct(), PublishStashedFileJob\__construct(), RefreshLinksJob2\__construct(), HTMLCacheUpdateJob\__construct(), DuplicateJob\__construct(), RefreshLinksJob\__construct(), UploadFromUrlJob\__construct(), NullJob\__construct(), __construct(), RefreshLinksJob2\getSingleTitleJobs(), HTMLCacheUpdateJob\invalidateTitles(), and RefreshLinksJob\runForTitle().