pastuhov / yii2-redis-ticker
Yii2 Redis ticker.
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.3.0
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-redis: ~2.0.0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
This package is not auto-updated.
Last update: 2024-12-25 20:25:06 UTC
README
Install
Via Composer
$ composer require pastuhov/yii2-redis-ticker
Features
- Just tick
Usage
$ticker = \Yii::createObject([ 'class' => \pastuhov\yii2redisticker\RedisTicker::className(), 'redis' => $redisConnection ]); $tickerName = 'tak'; if ($ticker->tick($tickerName, 15)) { $value++; } // value = 1 if ($ticker->tick($tickerName, 15)) { $value++; } // value = 1 sleep(20); if ($ticker->tick($tickerName, 15)) { $value++; } // value = 3
Testing
$ composer test
or
$ phpunit
Debugging
For debugging purposes use:
$ redis-cli monitor
or
$ tail -f tests/runtime/logs/app.log -n 1000
Security
If you discover any security related issues, please email kirill@pastukhov.su instead of using the issue tracker.
Credits
License
GNU General Public License, version 2. Please see License File for more information.