MediaWiki master
Wikimedia\LockManager\ILockManager Interface Reference

Interface representing MediaWiki's LockManager. More...

Inherited by Wikimedia\LockManager\LockManager.

Public Member Functions

 lockKey (string $key, int $timeout=0)
 Provide a mutex of the key.
 
 scopedLock (string $key, int $timeout=0)
 Lock a key and unlock it automatically when the object is destructed.
 
 unlockKey (string $key)
 

Detailed Description

Interface representing MediaWiki's LockManager.

Definition at line 10 of file ILockManager.php.

Member Function Documentation

◆ lockKey()

Wikimedia\LockManager\ILockManager::lockKey ( string $key,
int $timeout = 0 )

Provide a mutex of the key.

Parameters
string$keyKey to lock (relative to a domain, usually represented by the wiki ID, which callers don't need to specify)
int$timeoutTime to wait in seconds
Returns
bool true if the lock is acquired, false otherwise

Implemented in Wikimedia\LockManager\LockManager.

◆ scopedLock()

Wikimedia\LockManager\ILockManager::scopedLock ( string $key,
int $timeout = 0 )

Lock a key and unlock it automatically when the object is destructed.

Parameters
string$key
int$timeout
Returns
ScopedCallback|null returns null when we failed to acquire the lock

Implemented in Wikimedia\LockManager\LockManager.

◆ unlockKey()

Wikimedia\LockManager\ILockManager::unlockKey ( string $key)
Parameters
string$keyKey to unlock (relative to a domain, usually represented by the wiki ID, which callers don't need to specify)
Returns
bool true if the lock is released, false otherwise

Implemented in Wikimedia\LockManager\LockManager.


The documentation for this interface was generated from the following file: