| 1 |
<?php |
| 2 |
/** |
| 3 |
* The Lock contract that allows block acquisition. |
| 4 |
* |
| 5 |
* @package SolidWP\Performance |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace SolidWP\Performance\Lock\Contracts; |
| 11 |
|
| 12 |
use SolidWP\Performance\Lock\Exceptions\LockTimeoutException; |
| 13 |
|
| 14 |
/** |
| 15 |
* The Lock contract that allows block acquisition. |
| 16 |
* |
| 17 |
* @internal |
| 18 |
* |
| 19 |
* @package SolidWP\Performance |
| 20 |
*/ |
| 21 |
interface Blockable_Lock extends Lock { |
| 22 |
|
| 23 |
/** |
| 24 |
* Attempt to acquire the lock for the given number of seconds. |
| 25 |
* |
| 26 |
* @param int $seconds How long to wait to acquire the lock before giving up. |
| 27 |
* |
| 28 |
* @throws LockTimeoutException If we are unable to acquire the lock within the given seconds. |
| 29 |
* |
| 30 |
* @return bool |
| 31 |
*/ |
| 32 |
public function block( int $seconds ): bool; |
| 33 |
} |
| 34 |
|