PHPackages                             myservices/rpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. myservices/rpc

ActiveLibrary[API Development](/categories/api)

myservices/rpc
==============

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

v2.0(8y ago)582515MITPHPPHP &gt;=5.6.0

Since Feb 6Pushed 8y ago4 watchersCompare

[ Source](https://github.com/CrazyCodes/Rpc-Plugin)[ Packagist](https://packagist.org/packages/myservices/rpc)[ RSS](/packages/myservices-rpc/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (8)Used By (0)

前言
==

[](#前言)

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

服务治理构成
======

[](#服务治理构成)

- Swoole - 异步网络通信引擎 (即RPC) \[\]
- Supervisor - 进程管理 \[\]
- PHP7+ \[\]

安装
==

[](#安装)

### composer

[](#composer)

请拉取最新版本，老版本不可用

```
composer require myservices/rpc

```

### Git

[](#git)

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

```

配置文件
====

[](#配置文件)

配置文件 your\_path/config/app.php

- 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 监控/日志中心端口

部署&amp;开发
=========

[](#部署开发)

### 初始化

[](#初始化)

```
$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做进程管理

鸣谢
==

[](#鸣谢)

周梦康 \[\]

Swoole \[\]

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

7

Last Release

2995d ago

Major Versions

v1.4.1 → v2.02018-03-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd35ed20d6a23b0d9a3608e4d0b0bd08a4854da8086720f2e32312ca1c2ef72b?d=identicon)[CrazyCodes](/maintainers/CrazyCodes)

---

Top Contributors

[![CrazyCodes](https://avatars.githubusercontent.com/u/9151227?v=4)](https://github.com/CrazyCodes "CrazyCodes (38 commits)")

---

Tags

phprpcswoolelaraveltcpsoa

### Embed Badge

![Health badge](/badges/myservices-rpc/health.svg)

```
[![Health](https://phpackages.com/badges/myservices-rpc/health.svg)](https://phpackages.com/packages/myservices-rpc)
```

###  Alternatives

[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7648.2k](/packages/rakibdevs-openweather-laravel-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
