MediaWiki master
|
Job that has a run() method and metadata accessors for JobQueue::pop() and JobQueue::ack(). More...
Inherits IJobSpecification.
Inherited by Job.
Public Member Functions | |
allowRetries () | |
Whether to retry execution of this job if run() returned false or threw an exception. | |
getLastError () | |
getMetadata ( $field=null) | |
getReadyTimestamp () | |
getRequestId () | |
hasExecutionFlag ( $flag) | |
run () | |
Run the job. | |
setMetadata ( $field, $value) | |
tearDown ( $status) | |
Do any final cleanup after run(), deferred updates, and all DB commits happen. | |
toString () | |
workItemCount () | |
Public Member Functions inherited from IJobSpecification | |
getDeduplicationInfo () | |
Subclasses may need to override this to make duplication detection work. | |
getParams () | |
getReleaseTimestamp () | |
getRootJobParams () | |
getType () | |
hasRootJobParams () | |
ignoreDuplicates () | |
isRootJob () | |
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 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.
See the architecture doc for more information.
Definition at line 36 of file RunnableJob.php.
RunnableJob::allowRetries | ( | ) |
Whether to retry execution of this job if run() returned false
or threw an exception.
Implemented in Job, AssembleUploadChunksJob, and ThumbnailRenderJob.
RunnableJob::getLastError | ( | ) |
Implemented in Job.
RunnableJob::getMetadata | ( | $field = null | ) |
string | null | $field | Metadata field or null to get all the metadata |
Implemented in Job.
RunnableJob::getReadyTimestamp | ( | ) |
RunnableJob::getRequestId | ( | ) |
Implemented in Job.
RunnableJob::hasExecutionFlag | ( | $flag | ) |
RunnableJob::run | ( | ) |
Run the job.
If this method returns false
or completes exceptionally, the job runner will retry executing this job unless the number of retries has exceeded its configured retry limit. Retries are allowed by default, unless allowRetries() is overridden to disable retries.
See the architecture doc for more information.
false
to instruct the job runner to retry a failed job. Otherwise return true
to indicate that a job completed (i.e. succeeded, or failed in a way that's deterministic or redundant). Implemented in AssembleUploadChunksJob, CategoryMembershipChangeJob, CdnPurgeJob, DeleteLinksJob, DeletePageJob, DoubleRedirectJob, DuplicateJob, HTMLCacheUpdateJob, NullJob, ParsoidCachePrewarmJob, RefreshLinksJob, RevertedTagUpdateJob, ThumbnailRenderJob, UserOptionsUpdateJob, EmaillingJob, EnotifNotifyJob, RecentChangesUpdateJob, MediaWiki\RenameUser\RenameUserJob, UserEditCountInitJob, UserGroupExpiryJob, MediaWiki\Watchlist\ActivityUpdateJob, MediaWiki\Watchlist\ClearUserWatchlistJob, MediaWiki\Watchlist\ClearWatchlistNotificationsJob, and MediaWiki\Watchlist\WatchlistExpiryJob.
RunnableJob::setMetadata | ( | $field, | |
$value ) |
string | $field | Key name to set the value for |
mixed | $value | The value to set the field for |
Implemented in Job.
RunnableJob::tearDown | ( | $status | ) |
Do any final cleanup after run(), deferred updates, and all DB commits happen.
bool | $status | Whether the job, its deferred updates, and DB commit all succeeded |
RunnableJob::toString | ( | ) |
Implemented in Job.
RunnableJob::workItemCount | ( | ) |
Implemented in Job, HTMLCacheUpdateJob, and RefreshLinksJob.