PHP Class Metabor\Adapter\NinjaMutexLockAdapter

Author: Oliver Tischlinger
Inheritance: implements MetaborStd\Semaphore\LockAdapterInterface
显示文件 Open project: metabor/statemachine

Public Methods

Method Description
__construct ( NinjaMutex\Lock\LockInterface $ninjaMutexLock, null | integer $timeout = null )
acquireLock ( string $resourceName ) : boolean
isLocked ( string $resourceName ) : boolean
releaseLock ( string $resourceName ) : boolean

Method Details

__construct() public method

public __construct ( NinjaMutex\Lock\LockInterface $ninjaMutexLock, null | integer $timeout = null )
$ninjaMutexLock NinjaMutex\Lock\LockInterface
$timeout null | integer 1. null if you want blocking lock 2. 0 if you want just lock and go 3. $timeout > 0 if you want to wait for lock some time (in milliseconds)

acquireLock() public method

public acquireLock ( string $resourceName ) : boolean
$resourceName string
return boolean

isLocked() public method

public isLocked ( string $resourceName ) : boolean
$resourceName string
return boolean

releaseLock() public method

public releaseLock ( string $resourceName ) : boolean
$resourceName string
return boolean