Lock.php 818 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 bool
  18. */
  19. public function block($seconds, $callback = null);
  20. /**
  21. * Release the lock.
  22. *
  23. * @return void
  24. */
  25. public function release();
  26. /**
  27. * Returns the current owner of the lock.
  28. *
  29. * @return string
  30. */
  31. public function owner();
  32. /**
  33. * Releases this lock in disregard of ownership.
  34. *
  35. * @return void
  36. */
  37. public function forceRelease();
  38. }