2015-11-30 23:26:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
2018-10-22 22:58:02 +00:00
|
|
|
* Interface that deferrable updates can implement to signal that updates can be combined.
|
|
|
|
|
*
|
|
|
|
|
* DeferredUpdates uses this to merge all pending updates of PHP class into a single update
|
|
|
|
|
* by calling merge(). Note that upon merge(), the combined update goes to the back of the FIFO
|
|
|
|
|
* queue so that such updates occur after related non-mergeable deferred updates. For example,
|
2020-05-06 14:37:00 +00:00
|
|
|
* suppose updates that purge URL objects all use the same MergeableUpdate class, updates that
|
|
|
|
|
* delete URL objects use a different class, and the calling pattern is:
|
2018-10-22 22:58:02 +00:00
|
|
|
* - a) DeferredUpdates::addUpdate( $purgeCdnUrlsA );
|
|
|
|
|
* - b) DeferredUpdates::addUpdate( $deleteContentUrlsB );
|
|
|
|
|
* - c) DeferredUpdates::addUpdate( $purgeCdnUrlsB )
|
|
|
|
|
*
|
2020-05-06 14:37:00 +00:00
|
|
|
* In this case, purges for urls A and B will all happen after the $deleteContentUrlsB update.
|
2015-11-30 23:26:45 +00:00
|
|
|
*
|
2020-07-13 09:05:49 +00:00
|
|
|
* @stable to implement
|
2020-06-26 14:23:02 +00:00
|
|
|
*
|
2015-11-30 23:26:45 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
*/
|
2017-10-12 18:58:33 +00:00
|
|
|
interface MergeableUpdate extends DeferrableUpdate {
|
2015-11-30 23:26:45 +00:00
|
|
|
/**
|
2020-05-06 14:37:00 +00:00
|
|
|
* Merge this enqueued update with a new MergeableUpdate of the same qualified class name
|
2015-11-30 23:26:45 +00:00
|
|
|
*
|
2020-05-06 14:37:00 +00:00
|
|
|
* @param MergeableUpdate $update The new update (having the same class)
|
2015-11-30 23:26:45 +00:00
|
|
|
*/
|
2020-05-10 08:35:36 +00:00
|
|
|
public function merge( MergeableUpdate $update );
|
2015-11-30 23:26:45 +00:00
|
|
|
}
|