]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Lock/ILockDriver.php
Merge remote-tracking branch 'upstream/2019.03-RC' into worker2
[friendica.git] / src / Core / Lock / ILockDriver.php
index cd54cc03c3fb514a7a3462aa14a4c71eedb3953d..7cbaa4fc6908a701721c1886705a3a85c2ff3fae 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 namespace Friendica\Core\Lock;
+use Friendica\Core\Cache;
 
 /**
  * Lock Driver Interface
@@ -23,19 +24,21 @@ interface ILockDriver
         *
         * @param string  $key      The Name of the lock
         * @param integer $timeout  Seconds until we give up
+        * @param integer $ttl      Seconds The lock lifespan, must be one of the Cache constants
         *
         * @return boolean Was the lock successful?
         */
-       public function acquireLock($key, $timeout = 120);
+       public function acquireLock($key, $timeout = 120, $ttl = Cache::FIVE_MINUTES);
 
        /**
         * Releases a lock if it was set by us
         *
-        * @param string $key The Name of the lock
+        * @param string $key      The Name of the lock
+        * @param bool   $override Overrides the lock to get released
         *
         * @return void
         */
-       public function releaseLock($key);
+       public function releaseLock($key, $override = false);
 
        /**
         * Releases all lock that were set by us