deferred.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. deferred.txt
  2. A few of the database updates required by various functions here can be
  3. deferred until after the result page is displayed to the user. For example,
  4. updating the view counts, updating the linked-to tables after a save, etc. PHP
  5. does not yet have any way to tell the server to actually return and disconnect
  6. while still running these updates (as a Java servelet could), but it might have
  7. such a feature in the future.
  8. We handle these by creating a deferred-update object and putting those objects
  9. on a global list, then executing the whole list after the page is displayed. We
  10. don't do anything smart like collating updates to the same table or such
  11. because the list is almost always going to have just one item on it, if that,
  12. so it's not worth the trouble.
  13. Since 1.6 there is a 'job queue' in the jobs table, which is used to update
  14. link tables of transcluding pages after edits; this may be extended in the
  15. future to more general background tasks.
  16. Job queue items are fetched out of the queue and run either at a random rate
  17. during regular page views (by default) or by a batch process which can be run
  18. via maintenance/runJobs.php.
  19. Currently there are a few different types of jobs:
  20. refreshLinks
  21. Used to refresh the database tables that store the links between pages.
  22. When a page is changed, all pages using that page are also cleared by
  23. inserting a new job for all those pages. Each job refreshes only one page.
  24. htmlCacheUpdate
  25. Clear caches when a template is changed to ensure that changes can be seen.
  26. Each job clears $wgUpdateRowsPerJob pages (300 by default).
  27. enotifNotify
  28. Used to send mail using the job queue.