MediaWiki  master
IJobSpecification Interface Reference

Interface for serializable objects that describe a job queue task. More...

Inheritance diagram for IJobSpecification:

Public Member Functions

 getDeduplicationInfo ()
 Subclasses may need to override this to make duplication detection work. More...
 
 getParams ()
 
 getReleaseTimestamp ()
 
 getRootJobParams ()
 
 getType ()
 
 hasRootJobParams ()
 
 ignoreDuplicates ()
 
 isRootJob ()
 

Detailed Description

Interface for serializable objects that describe a job queue task.

A job specification can be inserted into a queue via JobQueue::push(). The specification parameters should be JSON serializable (e.g. no PHP classes). Whatever queue the job specification is pushed into is assumed to have job runners that will eventually pop the job specification from the queue, construct a RunnableJob instance from the specification, and then execute that instance via RunnableJob::run().

Since
1.23

Definition at line 35 of file IJobSpecification.php.

Member Function Documentation

◆ getDeduplicationInfo()

IJobSpecification::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

Implemented in RefreshLinksJob, CategoryMembershipChangeJob, Job, HTMLCacheUpdateJob, PublishStashedFileJob, AssembleUploadChunksJob, JobSpecification, and ClearUserWatchlistJob.

Referenced by JobQueueRedis\getNewJobFields(), and JobQueueDB\insertFields().

◆ getParams()

IJobSpecification::getParams ( )
Returns
array Parameters that specify sources, targets, and options for execution

Implemented in Job, and JobSpecification.

Referenced by JobQueueRedis\getNewJobFields(), JobQueueDB\insertFields(), JobQueueMemory\jobFromSpecInternal(), and DuplicateJob\newFromJob().

◆ getReleaseTimestamp()

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

Implemented in Job, and JobSpecification.

Referenced by JobQueueRedis\getNewJobFields().

◆ getRootJobParams()

◆ getType()

◆ hasRootJobParams()

◆ ignoreDuplicates()

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

Implemented in Job, and JobSpecification.

Referenced by JobQueueRedis\getNewJobFields().

◆ isRootJob()

IJobSpecification::isRootJob ( )
See also
JobQueue::deduplicateRootJob()
Returns
bool Whether this is job is a root job

Implemented in Job, and JobSpecification.


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