PHPackages                             connor/rpc-client - 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. connor/rpc-client

ActiveLibrary[API Development](/categories/api)

connor/rpc-client
=================

微服务rpc 调用client

1.0.1(8y ago)213MITPHP

Since Apr 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/cclehui/RpcClient)[ Packagist](https://packagist.org/packages/connor/rpc-client)[ RSS](/packages/connor-rpc-client/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (2)Used By (0)

适用场景
----

[](#适用场景)

在微服务和服务化的场景下，项目之间存在很多的远程调用场景，在一次请求中存在多次的远程rpc调用， 这种远程调用有的是基于tcp的，有的是基于http的， 为了提升调用性能，我们必须支持异步并发调用， 同时，我们还必须跟踪每次调用的调用链。RpcClient正好解决用来解决这两个问题。

安装
--

[](#安装)

直接通过composer安装

功能和使用说明
-------

[](#功能和使用说明)

### 基于http协议的rpc调用

[](#基于http协议的rpc调用)

HttpRpcClientUtil 在guzzle promise的基础上提供了同步和异步的http 远程调用类封装，在log中 收集了调用的信息，可以用于调用链的性能分析

```
//配置不同的handler来处理
$config = [
//        'handler' => new \GuzzleHttp\Handler\StreamHandler(),
//    'handler' => new \CClehui\RpcClient\GuzzleHandler\StreamSocketHandler(),
    'handler' => new \CClehui\RpcClient\GuzzleHandler\SocketHandler(),
];

//同步调用demo
$url = 'http://0.0.0.0/temp/test.php;
$params = [];
$rpc_client = new \CClehui\RpcClient\HttpRpcClientUtil();
$rpc_client->setGuzzleClientConfig($config);
$res = $rpc_client->callRemote($url, $params);

//异步调用demo (promise机制)
$url = 'http://0.0.0.0/temp/test.php';
$params = [];
$promises = [];
$rpc_client = new \CClehui\RpcClient\HttpRpcClientUtil();();
$rpc_client->setGuzzleClientConfig($config);

for ($i = 1; $i callRemote($url, $params, 'GET', [], true);
}

$result_list = \GuzzleHttp\Promise\settle($promises)->wait();

foreach($result_list as $key => $item) {
    $response = $item['value'];

    $response = (string)$response->getBody();
    echo $response . "\n";
}
```

更详细的使用demo在 examples\\HttpRpcDemo.php中

### StreamSocketHandler

[](#streamsockethandler)

见demo中的config配置， 可以配置该handler

### SocketHandler

[](#sockethandler)

见demo中的config配置， 可以配置该handler

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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 ~0 days

Total

2

Last Release

2964d ago

### Community

Maintainers

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

---

Top Contributors

[![cclehui](https://avatars.githubusercontent.com/u/5411898?v=4)](https://github.com/cclehui "cclehui (29 commits)")

---

Tags

clientrpc

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[crowdin/crowdin-api-client

PHP client library for Crowdin API v2

611.5M5](/packages/crowdin-crowdin-api-client)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[markrogoyski/numverify-api-client-php

Numverify API Client for PHP

1220.9k](/packages/markrogoyski-numverify-api-client-php)[spinen/laravel-clickup

SPINEN's Laravel Package for ClickUp.

282.2k](/packages/spinen-laravel-clickup)

PHPackages © 2026

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