Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 lines (38 sloc)
819 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Illuminate\Contracts\Cache; | |
interface Lock | |
{ | |
/** | |
* Attempt to acquire the lock. | |
* | |
* @param callable|null $callback | |
* @return mixed | |
*/ | |
public function get($callback = null); | |
/** | |
* Attempt to acquire the lock for the given number of seconds. | |
* | |
* @param int $seconds | |
* @param callable|null $callback | |
* @return mixed | |
*/ | |
public function block($seconds, $callback = null); | |
/** | |
* Release the lock. | |
* | |
* @return bool | |
*/ | |
public function release(); | |
/** | |
* Returns the current owner of the lock. | |
* | |
* @return string | |
*/ | |
public function owner(); | |
/** | |
* Releases this lock in disregard of ownership. | |
* | |
* @return void | |
*/ | |
public function forceRelease(); | |
} |