basecom/cronjob-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

basecom/cronjob-bundle

最新稳定版本:2.6.2

Composer 安装命令:

composer require basecom/cronjob-bundle

包简介

Bundle to write efficient and threadable cronjobs.

README 文档

README

License informations: LGPL

This bundle was made, to create powerfull and efficient cronjobs wich also can use multithreading (requires the php PCNTL-module).

Example

<?php

namespace basecom\ExampleBundle\Command;

use basecom\CronjobBundle\Command\CronjobCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ExampleCommand extends CronjobCommand
{
	protected function configure()
	{
		parent::configure();
		$this->setName('basecom:example');
		 	 ->setDescription('Shows the easy usage of this nice CronjobBundle');
	}

	protected function executeCronjob(InputInterface $input, OutputInterface $output, $loopcount, $preloopResult = null)
	{
		$output->writeln("Hello World!");
	}
}

In this basic configuration, the cronjob will run about 50 seconds and between each executeCronjob()-call will be a pause of one second.

If you trigger this command, you will see the "Hello World!"-output about 50 times.

Crontab handling

You can use the bundle for cronjob handling. Then you kann use the bsc:cronjob:produce for a worker to handle your comands via config.

basecom_cronjob:
    cronjobs:
        - {schedule: '* 5-23 * * *', script: 'app/console app:my:command --no-debug > /dev/null 2>&1'}

And add the Script to your crontab to run 5 minutes for example app/console bsc:cronjob:produce --runtime=255 --no-debug > /dev/null 2>&1 or add the command to your worker config.

Documentation

统计信息

  • 总下载量: 867
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 26
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL
  • 更新时间: 2012-11-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固