MediaWiki master
RunnableJob.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\JobQueue;
22
38interface RunnableJob extends IJobSpecification {
40 public const JOB_NO_EXPLICIT_TRX_ROUND = 1;
41
55 public function run();
56
61 public function getMetadata( $field = null );
62
68 public function setMetadata( $field, $value );
69
75 public function hasExecutionFlag( $flag );
76
83 public function getRequestId();
84
94 public function allowRetries();
95
101 public function workItemCount();
102
107 public function getReadyTimestamp();
108
114 public function tearDown( $status );
115
119 public function getLastError();
120
124 public function toString();
125}
126
128class_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.