承接 phuongdev89/yii2-cron 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phuongdev89/yii2-cron

Composer 安装命令:

composer require phuongdev89/yii2-cron

包简介

Auto block|unblock console command for the Yii2. One command without duplicate.

README 文档

README

Latest Stable Version Total Downloads

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.

Install

composer require phuongdev89/yii2-cron

Usage

Code

Any command can be converted to daemon

class AwesomeController extends \phuongdev89\cron\commands\DaemonController
{
    public $restartDb = false; //restart db connection every run, default is `false`

    public $db = 'db'; //name of db component need to restart, `db` that mean `Yii::$app->db`, default is `db`

    public $daemonDelay = 15; //delay time between run, in microsecond, default is `15`

    /**
     * Daemon name, unique
     *
     * @return string
     */
    protected function daemonName(): string
    {
        return 'mail-queue';
    }

    /**
     * repeatable function
     */
    public function worker()
    {
        // Some logic that will be repeateble 
    }
}

Command

Start repeat function

php yii awesome/start

Stop repeat function

php yii awesome/stop

Restart repeat function

php yii awesome/restart

Add to crontab:

* * * * * php yii awsome/start

统计信息

  • 总下载量: 215
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固