sadi01/yii2-mutex-filter
Composer 安装命令:
composer require sadi01/yii2-mutex-filter
包简介
MutexFilter is an action filter that apply mutex on controller's actions.
关键字:
README 文档
README
MutexFilter is an action filter relies on Yii2 Mutex component that apply mutex on controller's actions.
The Mutex component allows mutual execution of concurrent processes in order to prevent "race conditions". See Yii2 Mutex document.
Installation
The preferred way to install this extension is through composer.
Either run console command
composer require sadi01/yii2-mutex-filter "*"
Or add the package to the require section of your composer.json file:
{
"require": {
"sadi01/yii2-mutex-filter": "*"
}
}
then run composer update.
Usage
Config Yii2 Mutex component
[
'components' => [
'mutex' => [
'class' => 'yii\mutex\FileMutex'
],
],
]
Then, simply use MutexFilter in your controller's behaviors :
public function behaviors() { return [ 'mutexFilter' => [ 'class' => \sadi01\mutexFilter\MutexFilter::class, 'mutexKeyPostfix' => 'anyString', // Optional 'exceptActions' => ['index', 'view'] // Exclude some actions ] ]; }
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-03-24