diff options
author | Aaron Schulz <aschulz@wikimedia.org> | 2015-11-30 14:02:53 -0800 |
---|---|---|
committer | Timo Tijhof <krinklemail@gmail.com> | 2015-12-04 19:08:27 +0000 |
commit | 34dd248e285abbfab09f124ab7803b40101c5505 (patch) | |
tree | cafcb715e942e895f9f397cce1713f2ec230fbac /includes/deferred/DeferrableUpdate.php | |
parent | 323a2909ba1f43407ccba8bc1fadf2d25f2de488 (diff) | |
download | mediawikicore-34dd248e285abbfab09f124ab7803b40101c5505.tar.gz mediawikicore-34dd248e285abbfab09f124ab7803b40101c5505.zip |
Add pre-send update support to DeferredUpdates
* PRESEND/POSTSEND constants can now be used in addUpdate()
and addCallableUpdate() to control when the update runs.
This is useful for updates that may report errors the client
should see or to just get a head start on queued or pubsub
based updates like CDN purges. The OutputPage::output() method
can easily take a few 100ms.
* Removed some argument b/c code from doUpdates().
* Also moved DeferrableUpdate to a separate file.
Change-Id: I9831fe890f9f68f9ad8c4f4bba6921a8f29ba666
Diffstat (limited to 'includes/deferred/DeferrableUpdate.php')
-rw-r--r-- | includes/deferred/DeferrableUpdate.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/includes/deferred/DeferrableUpdate.php b/includes/deferred/DeferrableUpdate.php new file mode 100644 index 000000000000..5f4d821060f0 --- /dev/null +++ b/includes/deferred/DeferrableUpdate.php @@ -0,0 +1,14 @@ +<?php + +/** + * Interface that deferrable updates should implement. Basically required so we + * can validate input on DeferredUpdates::addUpdate() + * + * @since 1.19 + */ +interface DeferrableUpdate { + /** + * Perform the actual work + */ + function doUpdate(); +} |