Merge "Check Database::mSessionTempTables in Database::tableExists()"
[lhc/web/wiklou.git] / includes / libs / objectcache / MultiWriteBagOStuff.php
index ec588ce..9dcfa7c 100644 (file)
@@ -33,8 +33,6 @@ class MultiWriteBagOStuff extends BagOStuff {
        protected $caches;
        /** @var bool Use async secondary writes */
        protected $asyncWrites = false;
-       /** @var callback|null */
-       protected $asyncHandler;
 
        /** Idiom for "write to all backends" */
        const ALL = INF;
@@ -52,14 +50,12 @@ class MultiWriteBagOStuff extends BagOStuff {
         *      only use the primary store.
         *   - replication: Either 'sync' or 'async'. This controls whether writes
         *      to secondary stores are deferred when possible. Async writes
-        *      require setting 'asyncCallback'. HHVM register_postsend_function() function.
+        *      require setting 'asyncHandler'. HHVM register_postsend_function() function.
         *      Async writes can increase the chance of some race conditions
         *      or cause keys to expire seconds later than expected. It is
         *      safe to use for modules when cached values: are immutable,
         *      invalidation uses logical TTLs, invalidation uses etag/timestamp
         *      validation against the DB, or merge() is used to handle races.
-        *   - asyncHandler: callable that takes a callback and runs it after the
-        *      current web request ends. In CLI mode, it should run it immediately.
         * @param array $params
         * @throws InvalidArgumentException
         */
@@ -87,10 +83,8 @@ class MultiWriteBagOStuff extends BagOStuff {
                                $this->caches[] = ObjectFactory::getObjectFromSpec( $cacheInfo );
                        }
                }
+               $this->mergeFlagMaps( $this->caches );
 
-               $this->asyncHandler = isset( $params['asyncHandler'] )
-                       ? $params['asyncHandler']
-                       : null;
                $this->asyncWrites = (
                        isset( $params['replication'] ) &&
                        $params['replication'] === 'async' &&