PHP Class yii\mutex\PgsqlMutex

Application configuration example: [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'pgsql:host=127.0.0.1;dbname=demo', ] 'mutex' => [ 'class' => 'yii\mutex\PgsqlMutex', ], ], ]
See also: Mutex
Since: 2.0.8
Author: nineinchnick ([email protected])
Inheritance: extends yii\mutex\DbMutex
Datei anzeigen Open project: yiisoft/yii2

Public Methods

Method Description
init ( ) Initializes PgSQL specific mutex component implementation.

Protected Methods

Method Description
acquireLock ( string $name, integer $timeout ) : boolean Acquires lock by given name.
releaseLock ( string $name ) : boolean Releases lock by given name.

Private Methods

Method Description
getKeysFromName ( string $name ) : array Converts a string into two 16 bit integer keys using the SHA1 hash function.

Method Details

acquireLock() protected method

Acquires lock by given name.
See also: http://www.postgresql.org/docs/9.0/static/functions-admin.html
protected acquireLock ( string $name, integer $timeout ) : boolean
$name string of the lock to be acquired.
$timeout integer to wait for lock to become released.
return boolean acquiring result.

init() public method

Initializes PgSQL specific mutex component implementation.
public init ( )

releaseLock() protected method

Releases lock by given name.
See also: http://www.postgresql.org/docs/9.0/static/functions-admin.html
protected releaseLock ( string $name ) : boolean
$name string of the lock to be released.
return boolean release result.