| 1 | <?php |
| 2 | |
| 3 | namespace Illuminate\Contracts\Cache; |
| 4 | |
| 5 | interface Lock |
| 6 | { |
| 7 | /** |
| 8 | * Attempt to acquire the lock. |
| 9 | * |
| 10 | * @param callable|null $callback |
| 11 | * @return mixed |
| 12 | */ |
| 13 | public function get($callback = null); |
| 14 | |
| 15 | /** |
| 16 | * Attempt to acquire the lock for the given number of seconds. |
| 17 | * |
| 18 | * @param int $seconds |
| 19 | * @param callable|null $callback |
| 20 | * @return mixed |
| 21 | * |
| 22 | * @throws \Illuminate\Contracts\Cache\LockTimeoutException |
| 23 | */ |
| 24 | public function block($seconds, $callback = null); |
| 25 | |
| 26 | /** |
| 27 | * Release the lock. |
| 28 | * |
| 29 | * @return bool |
| 30 | */ |
| 31 | public function release(); |
| 32 | |
| 33 | /** |
| 34 | * Returns the current owner of the lock. |
| 35 | * |
| 36 | * @return string |
| 37 | */ |
| 38 | public function owner(); |
| 39 | |
| 40 | /** |
| 41 | * Releases this lock in disregard of ownership. |
| 42 | * |
| 43 | * @return void |
| 44 | */ |
| 45 | public function forceRelease(); |
| 46 | } |