Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiicod/yii2-cron
https://github.com/yiicod/yii2-cron
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yiicod/yii2-cron
- Owner: yiicod
- License: other
- Created: 2015-07-16T19:33:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T21:24:44.000Z (almost 7 years ago)
- Last Synced: 2024-11-13T16:12:47.832Z (about 2 months ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
Yii Cron extension
==================[![Latest Stable Version](https://poser.pugx.org/yiicod/yii2-cron/v/stable)](https://packagist.org/packages/yiicod/yii2-cron) [![Total Downloads](https://poser.pugx.org/yiicod/yii2-cron/downloads)](https://packagist.org/packages/yiicod/yii2-cron) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiicod/yii2-cron/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiicod/yii2-cron/?branch=master)[![Code Climate](https://codeclimate.com/github/yiicod/yii2-cron/badges/gpa.svg)](https://codeclimate.com/github/yiicod/yii2-cron)
Provide a logic and functionality to block console commands until they execute.
Unlocks commands exhibited at the expiration of the block if the server is down.#### Usage
```php
public function behaviors()
{
return array(
'LockUnLockBehavior' => array(
'class' => 'yiicod\cron\commands\behaviors\LockUnLockBehavior',
'timeLock' => 0 //Set time lock duration for command in seconds
)
);
}
```Any command can be converted to daemon
```php
class AwesomeCommand extends DaemonController
{
/**
* Daemon name
*
* @return string
*/
protected function daemonName(): string
{
return 'mail-queue';
}/**
* Run send mail
*/
public function worker()
{
// Some logic that will be repeateble
}
}
```