Manual:RunnableJob.php
Appearance
MediaWiki file: RunnableJob.php | |
---|---|
Location: | includes/jobqueue/ |
Source code: | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes: | RunnableJob |
Interface representing a Job queue task instance that can be executed through a run()
method. It also offers metadata accessors for both JobQueue::pop()
and JobQueue::ack()
. This interface extends IJobSpecification .
Public methods (dynamic)
[edit]- run() - execute the job (instance of JobQueue). Jobs may be first enqueued through JobQueue::push(). 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.
- getMetadata() - get metadata for field.
- setMetadata() - set metadata for field.
- hasExecutionFlag()
- getRequestId() - get the id of the request that created this job. Follows jobs recursively, allowing to track the id of the request that started a job when jobs insert jobs which insert other jobs.
- allowRetries() - set whether the job can be retried on failure by job runners.
- workItemCount() - Number of actual "work items" handled in this job.
- getReadyTimestamp() - get UNIX timestamp of the time the job was runnable, or null.
- tearDown() - do final cleanup after run(), deferred updates and all DB commits.
- getLastError()
- toString() - get debugging string.