MemcacheTimestampInvalidator.php in Memcache API and Integration 8.2
File
src/Invalidator/MemcacheTimestampInvalidator.php
View source
<?php
namespace Drupal\memcache\Invalidator;
use Drupal\memcache\Driver\MemcacheDriverFactory;
class MemcacheTimestampInvalidator extends TimestampInvalidatorBase {
protected $memcache;
public function __construct(MemcacheDriverFactory $memcache_factory, $bin, $tolerance = 0.001) {
parent::__construct($tolerance);
$this->memcache = $memcache_factory
->get($bin);
}
public function invalidateTimestamp($tag) {
return $this
->markAsOutdated($tag);
}
public function getLastInvalidationTimestamp($tag) {
return $this->memcache
->get($tag);
}
public function getLastInvalidationTimestamps(array $tags) {
return $this->memcache
->getMulti($tags);
}
protected function writeTimestamp($tag, $timestamp) {
return $this->memcache
->set($tag, $timestamp);
}
}