承接 moee/bushtaxi 相关项目开发

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

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

moee/bushtaxi

Composer 安装命令:

composer require moee/bushtaxi

包简介

ZeroMQ connection manager for PHP (alpha)

README 文档

README

Bushtaxi aims at making your life with ZeroMQ easier. It establishes connections and bindings based on simple configurations.

Usage

Client

A basic configuration for a req socket looks like this:

$config = [
  "service" => [ "name" => "client" ],
  "links" => [
    "server" => [
      "type" => "req",
      "connect" => "tcp://10.0.0.100:5000"
    ]
  ]
];

With this config you now can easily send a message to the socket specified in the config.

$bushtaxi = new Bushtaxi\Client($config);
$bushtaxi->server->send('Hello World');

Server

Binding sockets and running servers is as easy. First create a config.

$config = [
  "service" => [ "name" => "server" ],
  "links" => [
    "client" => [
	  "type" => "rep",
      "bind" => "tcp://10.0.0.100:5000
    ]
  ]
];

In addition to the config you also need to specify a server runtime class. This runtime class determines what happens in every loop.

$runtime = new class extends Bushtaxi\AbstractServerRuntime {
    function handle($links) {
		$message = $links['client']->recv();
		$links['client']->send("World");
    }
};

And we are good to go:

$bushtaxi = new Bushtaxi\Server($config, $runtime);
$bushtaxi->run();

You can find this example in the examples directory.

Run tests

cd bushtaxi
for f in $(find tests/*.yml); do docker-compose -f $f up; done

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固