Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 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 | public function block($seconds, $callback = null); |
| 23 | |
| 24 | /** |
| 25 | * Release the lock. |
| 26 | * |
| 27 | * @return bool |
| 28 | */ |
| 29 | public function release(); |
| 30 | |
| 31 | /** |
| 32 | * Returns the current owner of the lock. |
| 33 | * |
| 34 | * @return string |
| 35 | */ |
| 36 | public function owner(); |
| 37 | |
| 38 | /** |
| 39 | * Releases this lock in disregard of ownership. |
| 40 | * |
| 41 | * @return void |
| 42 | */ |
| 43 | public function forceRelease(); |
| 44 | } |