MediaWiki master
RunnableJob.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\JobQueue;
8
24interface RunnableJob extends IJobSpecification {
26 public const JOB_NO_EXPLICIT_TRX_ROUND = 1;
27
41 public function run();
42
47 public function getMetadata( $field = null );
48
54 public function setMetadata( $field, $value );
55
61 public function hasExecutionFlag( $flag );
62
69 public function getRequestId();
70
80 public function allowRetries();
81
87 public function workItemCount();
88
93 public function getReadyTimestamp();
94
100 public function tearDown( $status );
101
105 public function getLastError();
106
110 public function toString();
111}
112
114class_alias( RunnableJob::class, 'RunnableJob' );
Interface for serializable objects that describe a job queue task.
Job that has a run() method and metadata accessors for JobQueue::pop() and JobQueue::ack().
setMetadata( $field, $value)
allowRetries()
Whether to retry execution of this job if run() returned false or threw an exception.
tearDown( $status)
Do any final cleanup after run(), deferred updates, and all DB commits happen.