承接 rkr/service-dispatcher 相关项目开发

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

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

rkr/service-dispatcher

最新稳定版本:0.3.14

Composer 安装命令:

composer require rkr/service-dispatcher

包简介

README 文档

README

Build Status Scrutinizer Code Quality Latest Stable Version License

Common usage using SQLite

A simple service dispatcher for shell scripts. The intent is to run a php-cli script every minute and let the script decide, what to run at what time...

use Kir\Services\Cmd\Dispatcher\Dispatcher;

require __DIR__ . '/vendor/autoload.php';

use Kir\Services\Cmd\Dispatcher\ServiceDispatcherBuilder;

$dispatcher = ServiceDispatcherBuilder::withSQLite(__DIR__.'/services.db')->build();

$dispatcher->register('service1', Dispatcher::ONE_HOUR, function () {
	// Do something
	throw new Exception();
});

$dispatcher->register('service2', Dispatcher::ONE_HOUR * 3, function () {
	// Do something
});

$dispatcher->run();

The example above show the simplest usage of the service dispatcher. Two services get registered. "Service1" and "Service2". If one service throws an exception, the whole execution stops. Next time, the failed service starts at the end of the queue. If a service was successfully executed, the timeout schedules the service in this case to 1 hour (3600 seconds) in the future.

MySQL-Specific settings:

use Kir\Services\Cmd\Dispatcher\ServiceDispatcherBuilder;

require __DIR__ . '/vendor/autoload.php';

/* ...  */

$dispatcher = ServiceDispatcherBuilder::withMySQL($pdo)
->useLocking(true)
->setLockPrefix('my-app:')
->build();

$dispatcher->register(/*...*/);

/* ...  */

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固