MediaWiki master
|
Job that has a run() method and metadata accessors for JobQueue::pop() and JobQueue::ack(). More...
Inherits MediaWiki\JobQueue\IJobSpecification.
Inherited by MediaWiki\JobQueue\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 () | |
![]() | |
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 38 of file RunnableJob.php.
MediaWiki\JobQueue\RunnableJob::allowRetries | ( | ) |
Whether to retry execution of this job if run() returned false
or threw an exception.
Implemented in MediaWiki\JobQueue\Job, MediaWiki\JobQueue\Jobs\AssembleUploadChunksJob, and MediaWiki\JobQueue\Jobs\ThumbnailRenderJob.
MediaWiki\JobQueue\RunnableJob::getLastError | ( | ) |
Implemented in MediaWiki\JobQueue\Job.
MediaWiki\JobQueue\RunnableJob::getMetadata | ( | $field = null | ) |
string | null | $field | Metadata field or null to get all the metadata |
Implemented in MediaWiki\JobQueue\Job.
MediaWiki\JobQueue\RunnableJob::getReadyTimestamp | ( | ) |
Implemented in MediaWiki\JobQueue\Job.
MediaWiki\JobQueue\RunnableJob::getRequestId | ( | ) |
Implemented in MediaWiki\JobQueue\Job.
MediaWiki\JobQueue\RunnableJob::hasExecutionFlag | ( | $flag | ) |
int | $flag | JOB_* class constant |
Implemented in MediaWiki\JobQueue\Job.
MediaWiki\JobQueue\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 MediaWiki\JobQueue\Jobs\AssembleUploadChunksJob, MediaWiki\JobQueue\Jobs\CategoryMembershipChangeJob, MediaWiki\JobQueue\Jobs\CdnPurgeJob, MediaWiki\JobQueue\Jobs\DeleteLinksJob, MediaWiki\JobQueue\Jobs\DeletePageJob, MediaWiki\JobQueue\Jobs\DoubleRedirectJob, MediaWiki\JobQueue\Jobs\DuplicateJob, MediaWiki\JobQueue\Jobs\HTMLCacheUpdateJob, MediaWiki\JobQueue\Jobs\NullJob, MediaWiki\JobQueue\Jobs\ParsoidCachePrewarmJob, MediaWiki\JobQueue\Jobs\RefreshLinksJob, MediaWiki\JobQueue\Jobs\RevertedTagUpdateJob, MediaWiki\JobQueue\Jobs\ThumbnailRenderJob, EmaillingJob, EnotifNotifyJob, MediaWiki\RecentChanges\RecentChangesUpdateJob, MediaWiki\RenameUser\Job\RenameUserDerivedJob, MediaWiki\RenameUser\Job\RenameUserTableJob, UserOptionsUpdateJob, UserEditCountInitJob, UserGroupExpiryJob, MediaWiki\Watchlist\ActivityUpdateJob, MediaWiki\Watchlist\ClearUserWatchlistJob, MediaWiki\Watchlist\ClearWatchlistNotificationsJob, and MediaWiki\Watchlist\WatchlistExpiryJob.
MediaWiki\JobQueue\RunnableJob::setMetadata | ( | $field, | |
$value ) |
string | $field | Key name to set the value for |
mixed | $value | The value to set the field for |
Implemented in MediaWiki\JobQueue\Job.
MediaWiki\JobQueue\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 |
MediaWiki\JobQueue\RunnableJob::toString | ( | ) |
Implemented in MediaWiki\JobQueue\Job.
MediaWiki\JobQueue\RunnableJob::workItemCount | ( | ) |
Implemented in MediaWiki\JobQueue\Job, MediaWiki\JobQueue\Jobs\HTMLCacheUpdateJob, and MediaWiki\JobQueue\Jobs\RefreshLinksJob.