3 namespace Friendica\Core\Lock;
4 use Friendica\Core\Cache;
7 * Lock Driver Interface
9 * @author Philipp Holzer <admin@philipp.info>
14 * Checks, if a key is currently locked to a or my process
16 * @param string $key The name of the lock
19 public function isLocked($key);
23 * Acquires a lock for a given name
25 * @param string $key The Name of the lock
26 * @param integer $timeout Seconds until we give up
27 * @param integer $ttl Seconds The lock lifespan, must be one of the Cache constants
29 * @return boolean Was the lock successful?
31 public function acquireLock($key, $timeout = 120, $ttl = Cache::FIVE_MINUTES);
34 * Releases a lock if it was set by us
36 * @param string $key The Name of the lock
40 public function releaseLock($key);
43 * Releases all lock that were set by us
47 public function releaseAll();