MediaWiki  master
RunnableJob Interface Reference

Job that has a run() method and metadata accessors for JobQueue::pop() and JobQueue::ack() More...

Inheritance diagram for RunnableJob:
Collaboration diagram for RunnableJob:

Public Member Functions

 getMetadata ( $field=null)
 
 run ()
 Run the job. More...
 
 setMetadata ( $field, $value)
 
- Public Member Functions inherited from IJobSpecification
 getDeduplicationInfo ()
 Subclasses may need to override this to make duplication detection work. More...
 
 getParams ()
 
 getReleaseTimestamp ()
 
 getRootJobParams ()
 
 getType ()
 
 hasRootJobParams ()
 
 ignoreDuplicates ()
 
 isRootJob ()
 

Detailed Description

Job that has a run() method and metadata accessors for JobQueue::pop() and JobQueue::ack()

Instances are not only enqueueable via JobQueue::push(), but they can also be executed by by calling their run() method. When constructing a job to be enqueued via JobQueue::push(), it will not be possible to construct a RunnableJob instance if the class for that job is not loaded by the application for the local DB domain. In that case, the general-purpose JobSpecification class can be used instead.

Since
1.33

Definition at line 35 of file RunnableJob.php.

Member Function Documentation

◆ getMetadata()

RunnableJob::getMetadata (   $field = null)
Parameters
string | null$fieldMetadata field or null to get all the metadata
Returns
mixed|null Value; null if missing

Implemented in Job.

Referenced by JobQueueMemory\doAck(), JobQueueFederated\doAck(), JobQueueRedis\doAck(), JobQueueDB\doAck(), and DuplicateJob\newFromJob().

◆ run()

◆ setMetadata()

RunnableJob::setMetadata (   $field,
  $value 
)
Parameters
string$fieldKey name to set the value for
mixed$valueThe value to set the field for
Returns
mixed|null The prior field value; null if missing

Implemented in Job.


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