3 namespace MediaWiki\Deferred
;
6 * Interface that deferrable updates can implement to signal that updates can be combined.
8 * DeferredUpdates uses this to merge all pending updates of PHP class into a single update
9 * by calling merge(). Note that upon merge(), the combined update goes to the back of the FIFO
10 * queue so that such updates occur after related non-mergeable deferred updates. For example,
11 * suppose updates that purge URL objects all use the same MergeableUpdate class, updates that
12 * delete URL objects use a different class, and the calling pattern is:
13 * - a) DeferredUpdates::addUpdate( $purgeCdnUrlsA );
14 * - b) DeferredUpdates::addUpdate( $deleteContentUrlsB );
15 * - c) DeferredUpdates::addUpdate( $purgeCdnUrlsB )
17 * In this case, purges for urls A and B will all happen after the $deleteContentUrlsB update.
19 * @stable to implement
23 interface MergeableUpdate
extends DeferrableUpdate
{
25 * Merge this enqueued update with a new MergeableUpdate of the same qualified class name
27 * @param MergeableUpdate $update The new update (having the same class)
29 public function merge( MergeableUpdate
$update );
32 /** @deprecated class alias since 1.42 */
33 class_alias( MergeableUpdate
::class, 'MergeableUpdate' );