https://github.com/pastuhov/yii2-redis-ticker
Returns true every N seconds
https://github.com/pastuhov/yii2-redis-ticker
Last synced: 10 months ago
JSON representation
Returns true every N seconds
- Host: GitHub
- URL: https://github.com/pastuhov/yii2-redis-ticker
- Owner: pastuhov
- License: gpl-3.0
- Created: 2016-01-22T05:59:42.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-22T10:13:49.000Z (almost 10 years ago)
- Last Synced: 2025-02-23T11:36:43.307Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yii2 redis ticker
[](https://travis-ci.org/pastuhov/yii2-redis-ticker)
[](https://scrutinizer-ci.com/g/pastuhov/yii2-redis-ticker/?branch=master)
[](https://scrutinizer-ci.com/g/pastuhov/yii2-redis-ticker/?branch=master)
[](https://packagist.org/packages/pastuhov/yii2-redis-ticker)
## Install
Via Composer
``` bash
$ composer require pastuhov/yii2-redis-ticker
```
## Features
* Just tick
## Usage
```php
$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
```bash
$ composer test
```
or
```bash
$ phpunit
```
## Debugging
For debugging purposes use:
```bash
$ redis-cli monitor
```
or
```bash
$ 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
- [Kirill Pastukhov](https://github.com/pastuhov)
- [All Contributors](../../contributors)
## License
GNU General Public License, version 2. Please see [License File](LICENSE) for more information.