Lock.php 890 B

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