credy / yii2-leakybucket
1.0.1
2024-07-05 15:48 UTC
Requires
- yiisoft/yii2: >=2.0
Requires (Dev)
- codeception/codeception: ^4.0 | ^5.0
- codeception/module-asserts: ^1.1 | ^3.0
- codeception/module-yii2: ^1.1
- codeception/stub: dev-42-for-4-0-branch-as-well as 4.0.x-dev
- credy/tc-coding-standard: dev-master
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- yiisoft/yii2-redis: ^2.0
Suggests
- yiisoft/yii2-redis:^2.0: If you want to use RedisHandler
This package is auto-updated.
Last update: 2024-12-05 14:03:29 UTC
README
===========
Configuration:
LeakyBucket Component:
Put following snippet into your config
return [
'components' => [
'leakyBucket' => [
'class' => credy\leakyBucket\handlers\DummyHandler::class,
]
]
];
Usage
In your class:
class YourClassName extends BaseObject
{
public function yourMethod()
{
Yii::$app->leakyBucket->try(
'unique key',
function () {
//insert your code here
}
);
}
}