mirror of
https://github.com/friendica/friendica
synced 2024-06-17 07:37:55 +02:00
Philipp Holzer
3f7e4f5bb6
- New Factory "CacheDriverFactory" for Cache and Locks - Adding Redis/Memcached Locking - Moved Lock to Core - other improvements
39 lines
708 B
PHP
39 lines
708 B
PHP
<?php
|
|
|
|
namespace Friendica\Core\Lock;
|
|
|
|
/**
|
|
* Lock Driver Interface
|
|
*
|
|
* @author Philipp Holzer <admin@philipp.info>
|
|
*/
|
|
interface ILockDriver
|
|
{
|
|
/**
|
|
*
|
|
* @brief Acquires a lock for a given name
|
|
*
|
|
* @param string $key The Name of the lock
|
|
* @param integer $timeout Seconds until we give up
|
|
*
|
|
* @return boolean Was the lock successful?
|
|
*/
|
|
public function acquireLock(string $key, int $timeout = 120);
|
|
|
|
/**
|
|
* @brief Releases a lock if it was set by us
|
|
*
|
|
* @param string $key The Name of the lock
|
|
*
|
|
* @return void
|
|
*/
|
|
public function releaseLock(string $key);
|
|
|
|
/**
|
|
* @brief Releases all lock that were set by us
|
|
*
|
|
* @return void
|
|
*/
|
|
public function releaseAll();
|
|
}
|