MediaWiki  REL1_24
JobSpecification Class Reference

Job queue task description base code. More...

Inheritance diagram for JobSpecification:
Collaboration diagram for JobSpecification:

List of all members.

Public Member Functions

 __construct ($type, array $params, array $opts=array(), Title $title=null)
 getDeduplicationInfo ()
 Subclasses may need to override this to make duplication detection work.
 getParams ()
 getReleaseTimestamp ()
 getTitle ()
 getType ()
 ignoreDuplicates ()

Protected Member Functions

 validateParams (array $params)

Protected Attributes

bool $ignoreDuplicates
 Expensive jobs may set this to true *.
array $params
 Array of job parameters or false if none *.
Title $title
 *
string $type
 *

Detailed Description

Job queue task description base code.

Example usage: $job = new JobSpecification( 'null', array( 'lives' => 1, 'usleep' => 100, 'pi' => 3.141569 ), array( 'removeDuplicates' => 1 ), Title::makeTitle( NS_SPECIAL, 'nullity' ) ); JobQueueGroup::singleton()->push( $job )

Since:
1.23

Definition at line 84 of file JobSpecification.php.


Constructor & Destructor Documentation

JobSpecification::__construct ( type,
array params,
array opts = array(),
Title title = null 
)
Parameters:
string$type
array$paramsMap of key/values
array$optsMap of key/values
Title$titleOptional descriptive title

Definition at line 99 of file JobSpecification.php.


Member Function Documentation

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.

Returns:
array Map of key/values

Implements IJobSpecification.

Definition at line 168 of file JobSpecification.php.

Returns:
array

Implements IJobSpecification.

Definition at line 140 of file JobSpecification.php.

Returns:
int|null UNIX timestamp to delay running this job until, otherwise null

Implements IJobSpecification.

Definition at line 147 of file JobSpecification.php.

References wfTimestampOrNull().

Returns:
Title

Implements IJobSpecification.

Definition at line 133 of file JobSpecification.php.

References title.

Returns:
string

Implements IJobSpecification.

Definition at line 126 of file JobSpecification.php.

References type.

Returns:
bool Whether only one of each identical set of jobs should be run

Implements IJobSpecification.

Definition at line 156 of file JobSpecification.php.

JobSpecification::validateParams ( array params) [protected]
Parameters:
array$params

Definition at line 113 of file JobSpecification.php.

References as.


Member Data Documentation

bool JobSpecification::$ignoreDuplicates [protected]

Expensive jobs may set this to true *.

Definition at line 91 of file JobSpecification.php.

array JobSpecification::$params [protected]

Array of job parameters or false if none *.

Definition at line 87 of file JobSpecification.php.

Title JobSpecification::$title [protected]

*

Definition at line 89 of file JobSpecification.php.

string JobSpecification::$type [protected]

*

Definition at line 85 of file JobSpecification.php.


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