public function lock(Request $request)
    {
        $cacheKey = $this->getCacheKey($request);

        if (isset($this->locks[$cacheKey])) {
            return false;
        }

        $this->locks[$cacheKey] = $this->lockFactory
            ->createLock($cacheKey);

        return $this->locks[$cacheKey]->acquire();
    }
public function lock(Request $request)
    {
        $cacheKey = $this->getCacheKey($request);

        if (isset($this->locks[$cacheKey])) {
            return false;
        }

        $this->locks[$cacheKey] = $this->lockFactory
            ->createLock($cacheKey);

        return $this->locks[$cacheKey]->acquire();
    }
public function lock ( Request $ request ) { $ cacheKey = $ this -> getCacheKey ( $ request ) ; if ( isset ( $ this -> locks [ $ cacheKey ] ) ) { return false ; } $ this -> locks [ $ cacheKey ] = $ this -> lockFactory -> createLock ( $ cacheKey ) ; return $ this -> locks [ $ cacheKey ] -> acquire ( ) ; }
Locks the cache for a given Request.

@param Request $request A Request instance

@return bool|string true if the lock is acquired, the path to the current lock otherwise
Locks the cache for a given Request .