Jump to content

Manual:RunnableJob.php

From mediawiki.org

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.

See also

[edit]