Job Class Reference
[JobQueue]

Class to both describe a background job and handle jobs. More...

Inherited by DoubleRedirectJob, EmaillingJob, EnotifNotifyJob, HTMLCacheUpdateJob, RefreshLinksJob, and RefreshLinksJob2.

List of all members.

Public Member Functions

 run ()
 Run the job.
 __construct ($command, $title, $params=false, $id=0)
 insert ()
 Insert a single job into the queue.
 toString ()
 getLastError ()

Static Public Member Functions

static pop_type ($type)
 static function queueLinksJobs( $titles ) {}
static pop ($offset=0)
 Pop a job off the front of the queue.
static factory ($command, $title, $params=false, $id=0)
 Create the appropriate object to handle a specific job.
static makeBlob ($params)
static extractBlob ($blob)
static batchInsert ($jobs)
 Batch-insert a group of jobs into the queue.

Public Attributes

 $command
 $title
 $params
 $id
 $removeDuplicates
 $error

Protected Member Functions

 insertFields ()
 setLastError ($error)


Detailed Description

Class to both describe a background job and handle jobs.

Definition at line 15 of file JobQueue.php.


Constructor & Destructor Documentation

Job::__construct ( command,
title,
params = false,
id = 0 
)

Definition at line 245 of file JobQueue.php.

References $command, $id, $params, and $title.


Member Function Documentation

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.

Parameters:
$jobs array of Job objects

Definition at line 218 of file JobQueue.php.

References $dbw, $job, $rows, and wfGetDB().

Referenced by DoubleRedirectJob::fixRedirects(), HTMLCacheUpdate::insertJobs(), LinksUpdate::queueRecursiveJobs(), and RefreshLinksJob2::run().

static Job::extractBlob ( blob  )  [static]

Definition at line 201 of file JobQueue.php.

References $blob.

Referenced by pop(), and pop_type().

static Job::factory ( command,
title,
params = false,
id = 0 
) [static]

Create the appropriate object to handle a specific job.

Parameters:
$command String: Job command
$title Title: Associated title
$params Array: Job parameters
$id Int: Job identifier
Returns:
Job

Definition at line 184 of file JobQueue.php.

References $command, $id, $params, $title, and $wgJobClasses.

Referenced by pop(), pop_type(), and MWGearmanJob::runNoSwitch().

Job::getLastError (  ) 

Definition at line 309 of file JobQueue.php.

Job::insert (  ) 

Insert a single job into the queue.

Definition at line 259 of file JobQueue.php.

References $dbw, $fields, $res, insertFields(), and wfGetDB().

Job::insertFields (  )  [protected]

Definition at line 274 of file JobQueue.php.

References makeBlob().

Referenced by insert().

static Job::makeBlob ( params  )  [static]

Definition at line 193 of file JobQueue.php.

References $params.

Referenced by insertFields().

static Job::pop ( offset = 0  )  [static]

Pop a job off the front of the queue.

Parameters:
$offset Number of jobs to skip
Returns:
Job or false if there's no jobs

Definition at line 90 of file JobQueue.php.

References $affected, $dbr, $dbw, $job, $offset, $row, $title, extractBlob(), factory(), Title::makeTitleSafe(), wfGetDB(), wfProfileIn(), and wfProfileOut().

Referenced by MediaWiki::doJobs().

static Job::pop_type ( type  )  [static]

static function queueLinksJobs( $titles ) {}

Deprecated:
use LinksUpdate::queueRecursiveJobs()
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.

Definition at line 49 of file JobQueue.php.

References $affected, $dbw, $job, $row, $title, $type, extractBlob(), factory(), Title::makeTitleSafe(), wfGetDB(), and wfProfileOut().

Job::run (  )  [abstract]

Run the job.

Returns:
boolean success

Reimplemented in DoubleRedirectJob, EmaillingJob, EnotifNotifyJob, HTMLCacheUpdateJob, RefreshLinksJob, and RefreshLinksJob2.

Job::setLastError ( error  )  [protected]

Definition at line 305 of file JobQueue.php.

References $error.

Referenced by DoubleRedirectJob::run().

Job::toString (  ) 

Definition at line 283 of file JobQueue.php.

References $key, and $s.


Member Data Documentation

Job::$command

Definition at line 16 of file JobQueue.php.

Referenced by __construct(), and factory().

Job::$error

Definition at line 16 of file JobQueue.php.

Referenced by setLastError().

Job::$id

Job::$params

Job::$removeDuplicates

Definition at line 16 of file JobQueue.php.

Job::$title


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:39 2009 for MediaWiki by  doxygen 1.5.9