doc updates
[lhc/web/wiklou.git] / docs / deferred.txt
1
2 deferred.txt
3
4 A few of the database updates required by various functions here
5 can be deferred until after the result page is displayed to the
6 user. For example, updating the view counts, updating the
7 linked-to tables after a save, etc. PHP does not yet have any
8 way to tell the server to actually return and disconnect while
9 still running these updates (as a Java servelet could), but it
10 might have such a feature in the future.
11
12 We handle these by creating a deferred-update object (in a real
13 O-O language these would be classes that implement an interface)
14 and putting those objects on a global list, then executing the
15 whole list after the page is displayed. We don't do anything
16 smart like collating updates to the same table or such because
17 the list is almost always going to have just one item on it, if
18 that, so it's not worth the trouble.
19
20
21 Since 1.6 there is a 'job queue' in the jobs table, which is used
22 to update link tables of transcluding pages after edits; this
23 may be extended in the future to more general background tasks.
24
25 Job queue items are fetched out of the queue and run either
26 at a random rate during regular page views (by default) or by
27 a batch process which can be run via maintenance/runJobs.php.