This class accepts 2 caches: a KeyValueStore object (the real cache) and a Buffer instance (to read data from as long as it hasn't been committed) Every write action will first store the data in the Buffer instance, and then pas update along to $defer. Once commit() is called, $defer will execute all these updates against the real cache. All deferred writes that fail to apply will cause that cache key to be deleted, to ensure cache consistency. Until commit() is called, all data is read from the temporary Buffer instance.
Author: Matthias Mullie (scrapbook@mullie.eu)
Inheritance: implements MatthiasMullie\Scrapbook\KeyValueStore
コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function flush()
 {
     $result = $this->transaction->flush();
     $this->transaction->commit();
     return $result;
 }