Code Monkey home page Code Monkey logo

swoole_crontab's Introduction

swoole_crontab

基于swoole开发的定时执行框架,多进程并发执行,执行时间监控,注入monolog日志框架方便调试

#启动:
php main.php -s start
php main.php -s start -d # 守护进程启动
#关闭:
php main.php -s stop
#热加载配置:
php main.php -s reload

表结构:

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for task
-- ----------------------------
DROP TABLE IF EXISTS `task`;
CREATE TABLE `task` (
  `id` int(11) NOT NULL DEFAULT '0' COMMENT '任务ID',
  `name` varchar(256) DEFAULT '' COMMENT '任务名称',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '1. 执行一次 2.循环执行',
  `separate_time` int(11) DEFAULT NULL COMMENT '执行间隔',
  `status` tinyint(4) DEFAULT NULL COMMENT '执行状态 0.未开始 1. 执行中 -1.执行失败 -2.手动暂停',
  `remark` text COMMENT '备注信息',
  `fn` text COMMENT '要执行的数据库存储过程或函数',
  `start_time` datetime DEFAULT NULL COMMENT '开始执行时间',
  `next_exec_time` datetime DEFAULT NULL COMMENT '下次执行时间',
  `last_exec_time` datetime DEFAULT NULL COMMENT '上次执行时间',
  `fn_type` varchar(64) DEFAULT NULL COMMENT 'email, sql 等等',
  `pid` int(11) DEFAULT '0' COMMENT '当前执行任务的进程id',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of task
-- ----------------------------
INSERT INTO `task` VALUES ('4', 'hello_world', '2015-08-21 11:21:10', '2', '86400', '0', '你好世界', 'shell', '2015-09-09 00:21:24', '2016-02-02 00:11:24', '2016-02-01 00:11:24', 'php', '0');

swoole_crontab's People

Contributors

xuguoliangjj avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.