定制 indigophp/doris 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

indigophp/doris

Composer 安装命令:

composer require indigophp/doris

包简介

Doris is a remote command bus implementation based on Bernard and Tactician

README 文档

README

Latest Version Software License Build Status Code Coverage Quality Score HHVM Status Total Downloads

Doris is a remote command bus implementation based on Bernard and Tactician.

Install

Via Composer

$ composer require indigophp/doris

Usage

Install Doris in both your application and (if you have any) dedicated worker package/instance.

You can run your consumer directly using your application, however you should avoid it if possible. Bootstrapping your application consumes more resource than necessary. (That said, sometimes it is simply easier.) In this case you have to make sure that you provide your consumer instance with all the data it needs: database connection details, required dependencies, etc.

Remote execution

To send a command to it's destination, simply create a remote executing command bus, and use it like you would use any other:

use Doris\RemoteCommandBus;

// ...create a Bernard\Queue instance
// make sure to add te appropriate serializers

$commandBus = new RemoteCommandBus($queue);

$commandBus->execute($command);

Consuming commands

On the other side of the message queue you must set up a consumer:

use Doris\Consumer;
use Doris\Listener\CommandLimit;

// ... create your inner commandBus

$consumer = new Consumer;

// execute maximum of 10 commands
$consumer->addListener(new CommandLimit(10));

$consumer->consume($queue, $commandBus);

List of available listeners:

  • CommandLimit: limits how many commands should be executed
  • TimeLimit: limits how long the consumer can run
  • Wait: wait for some time at the end of every cycle

Testing

$ phpspec run

Contributing

Please see CONTRIBUTING for details.

Credits

Name refers to the film Bernard and Doris.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固