library yii2-semaphore-mutex
Implementation of semaphore mutex
achertovsky/yii2-semaphore-mutex
Implementation of semaphore mutex
- Monday, February 19, 2018
- by achertovsky
- Repository
- 1 Watchers
- 0 Stars
- 82 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 6 % Grown
yii2-semaphore-mutex
Description
Implementation of mutex through semaphore. Good for providing atomic access, (*1)
Installing
The preferred way to install this extension is through composer., (*2)
{
"require": {
"achertovsky/yii2-semaphore-mutex": "@dev"
}
}
or, (*3)
composer require achertovsky/yii2-semaphore-mutex "@dev"
Usage
Add to components, (*4)
[
'components' => [
'mutex' => [
'class' => 'yii\mutex\FileMutex'
],
],
]
Use by, (*5)
$name = 'test mutex';
//use null to wait infinite or amount of seconds to wait in second param
Yii::$app->mutex->acquire($name, $infiniteWait ? null : 15);
Yii::$app->mutex->release($name);
dev-master
9999999-dev
Implementation of semaphore mutex
Sources
Download
The Requires