Metaphore\Cache::getLockManager PHP Method

getLockManager() public method

public getLockManager ( ) : LockManager
return LockManager
    public function getLockManager()
    {
        return $this->lockManager;
    }

Usage Example

Exemplo n.º 1
0
 public function testCallableCanReturnDifferentValueIfNotStaleContentAvailableToServe()
 {
     $cache = new Cache(new MockStore());
     $customValue = 'custom_value';
     $cache->onNoStaleCache(function (NoStaleCacheEvent $event) use($customValue) {
         $event->setResult($customValue);
     });
     $key = 'lamela';
     $value = 'Tottenham Rabona';
     $ttl = 30;
     // simulate lock (other process generating content)
     $cache->getLockManager()->acquire($key, 30);
     $result = $cache->cache($key, $this->createFunc($value), $ttl);
     $this->assertSame($customValue, $result);
 }