2017 © Pedro Peláez
 

library rpc

服务治理消费者&提供者插件

image

myservices/rpc

服务治理消费者&提供者插件

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 8 Versions
  • 50 % Grown

The README.md

前言

  • 这是一款基于Swoole的服务治理架构
  • 我的服务治理仅仅是使用了概念,并非是大型企业中完善的服务治理框架,请酌情使用在生产环境中

服务治理构成

  • Swoole - 异步网络通信引擎 (即RPC) [https://www.swoole.com/]
  • Supervisor - 进程管理 [http://www.supervisord.org/]
  • PHP7+ [http://php.net/]

安装

composer

请拉取最新版本,老版本不可用, (*1)

composer require myservices/rpc

Git

git clone https://github.com/CrazyCodes/Rpc-Plugin.git

配置文件

配置文件 your_path/config/app.php, (*2)

  • app_name 项目目录
  • base_path 根目录
  • develop_path 开发者目录
  • production_path 生产环境目录
  • server_ip 服务监听IP
  • server_port 服务监听端口
  • server_notify_port 服务监听回调端口
  • management_center_ip 服务治理中心IP (服务治理中心正在Coding)
  • management_center_port 服务治理中心端口
  • monitoring_center_ip 监控/日志中心IP (监控/日志中心正在Coding)
  • monitoring_center_port 监控/日志中心端口

部署&开发

初始化

$client = new \Rpc\RpcProvider(当前项目的根目录地址);

启动提供者/消费者

$client->server ();

请求提供者 (生产模式)

$production = $client->client ('UserService');
var_dump ($production->getUserInfo (['name' => 111]));

请求提供者 (开发模式)

$dev = $client->devClient ('UserService');
var_dump ($dev->getUserInfo (['name' => 111]));

启动日志(监控)系统

$monitor = new \Rpc\RpcProvider(BASE_PATH);
$monitor->monitorStart ();

监听

SwooleTcpServer 只能在CLI中执行,所以我选择使用Supervisor做进程管理, (*3)

鸣谢

周梦康 [https://mengkang.net/], (*4)

Swoole [https://www.swoole.com/], (*5)

The Versions

09/03 2018

dev-master

9999999-dev

服务治理消费者&提供者插件

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Crazy

laravel soa tcp 服务治理

01/03 2018

v2.0

2.0.0.0

服务治理消费者&提供者插件

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Crazy

laravel soa tcp 服务治理

08/02 2018

v1.4.1

1.4.1.0

这是一个基于Laravel,为了实现服务治理的Server快速启动脚本

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Crazy

laravel soa tcp 服务治理

08/02 2018

v1.4

1.4.0.0

这是一个基于Laravel,为了实现服务治理的Server快速启动脚本

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Crazy

laravel soa tcp 服务治理

08/02 2018

v1.3

1.3.0.0

这是一个基于Laravel,为了实现服务治理的Server快速启动脚本

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Crazy

laravel soa tcp 服务治理

08/02 2018

v1.2

1.2.0.0

这是一个基于Laravel,为了实现服务治理的Server快速启动脚本

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Crazy

laravel soa tcp 服务治理

08/02 2018

v1.1

1.1.0.0

这是一个基于Laravel,为了实现服务治理的Server快速启动脚本

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Crazy

laravel soa tcp 服务治理

06/02 2018

v1.0

1.0.0.0

这是一个基于Laravel,为了实现服务治理的Server快速启动脚本

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Crazy

laravel soa tcp 服务治理