MediaWiki  1.23.2
JobSpecification Class Reference

Job queue task description base code. More...

Inheritance diagram for JobSpecification:
Collaboration diagram for JobSpecification:

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. More...
 
 getParams ()
 
 getReleaseTimestamp ()
 
 getTitle ()
 
 getType ()
 
 ignoreDuplicates ()
 

Protected Member Functions

 validateParams (array $params)
 

Protected Attributes

bool $ignoreDuplicates
 Expensive jobs may set this to true *. More...
 
array $params
 Array of job parameters or false if none *. More...
 
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

◆ __construct()

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.

References $params, $type, ignoreDuplicates(), Title\newMainPage(), title, type, and validateParams().

Member Function Documentation

◆ getDeduplicationInfo()

JobSpecification::getDeduplicationInfo ( )

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.

References array(), getParams(), getTitle(), and getType().

◆ getParams()

JobSpecification::getParams ( )
Returns
array

Implements IJobSpecification.

Definition at line 140 of file JobSpecification.php.

References $params.

Referenced by getDeduplicationInfo().

◆ getReleaseTimestamp()

JobSpecification::getReleaseTimestamp ( )
Returns
int|null UNIX timestamp to delay running this job until, otherwise null

Implements IJobSpecification.

Definition at line 147 of file JobSpecification.php.

References TS_UNIX, and wfTimestampOrNull().

◆ getTitle()

JobSpecification::getTitle ( )
Returns
Title

Implements IJobSpecification.

Definition at line 133 of file JobSpecification.php.

References $title.

Referenced by getDeduplicationInfo().

◆ getType()

JobSpecification::getType ( )
Returns
string

Implements IJobSpecification.

Definition at line 126 of file JobSpecification.php.

References $type.

Referenced by getDeduplicationInfo().

◆ ignoreDuplicates()

JobSpecification::ignoreDuplicates ( )
Returns
bool Whether only one of each identical set of jobs should be run

Implements IJobSpecification.

Definition at line 156 of file JobSpecification.php.

References $ignoreDuplicates.

Referenced by __construct().

◆ validateParams()

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

Definition at line 113 of file JobSpecification.php.

References $params, and as.

Referenced by __construct().

Member Data Documentation

◆ $ignoreDuplicates

bool JobSpecification::$ignoreDuplicates
protected

Expensive jobs may set this to true *.

Definition at line 91 of file JobSpecification.php.

Referenced by ignoreDuplicates().

◆ $params

array JobSpecification::$params
protected

Array of job parameters or false if none *.

Definition at line 87 of file JobSpecification.php.

Referenced by __construct(), getParams(), and validateParams().

◆ $title

Title JobSpecification::$title
protected

Definition at line 89 of file JobSpecification.php.

Referenced by getTitle().

◆ $type

string JobSpecification::$type
protected

Definition at line 85 of file JobSpecification.php.

Referenced by __construct(), and getType().


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