BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
JobSpecification Class Reference
Inheritance diagram for JobSpecification:
Collaboration diagram for JobSpecification:

Public Member Functions

 __construct ($type, array $params, array $opts=[], Title $title=null)
 
 getType ()
 
 getTitle ()
 
 getParams ()
 
 getReleaseTimestamp ()
 
 ignoreDuplicates ()
 
 getDeduplicationInfo ()
 
 getRootJobParams ()
 
 hasRootJobParams ()
 
 isRootJob ()
 
 toSerializableArray ()
 

Static Public Member Functions

static newFromArray (array $map)
 

Protected Member Functions

 validateParams (array $params)
 

Protected Attributes

 $type
 
 $params
 
 $title
 
 $opts
 

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

Constructor & Destructor Documentation

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

Member Function Documentation

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.

JobSpecification::getParams ( )
Returns
array

Implements IJobSpecification.

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

Implements IJobSpecification.

JobSpecification::getRootJobParams ( )
See Also
JobQueue::deduplicateRootJob()
Returns
array
Since
1.26

Implements IJobSpecification.

JobSpecification::getTitle ( )
Returns
Title Descriptive title (this can simply be informative)

Implements IJobSpecification.

JobSpecification::getType ( )
Returns
string Job type

Implements IJobSpecification.

JobSpecification::hasRootJobParams ( )
See Also
JobQueue::deduplicateRootJob()
Returns
bool
Since
1.22

Implements IJobSpecification.

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

Implements IJobSpecification.

JobSpecification::isRootJob ( )
See Also
JobQueue::deduplicateRootJob()
Returns
bool Whether this is job is a root job

Implements IJobSpecification.

static JobSpecification::newFromArray ( array  $map)
static
Parameters
array$mapField/value map
Returns
JobSpecification
Since
1.25
JobSpecification::toSerializableArray ( )
Returns
array Field/value map that can immediately be serialized
Since
1.25
JobSpecification::validateParams ( array  $params)
protected
Parameters
array$params

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