定制 crayoon/hyperf-grpc-client 二次开发

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

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

crayoon/hyperf-grpc-client

最新稳定版本:0.1.2

Composer 安装命令:

composer require crayoon/hyperf-grpc-client

包简介

hyperf grpc client

README 文档

README

hyperf grpc 客户端,支持服务发现、负载均衡、Dtm通过服务发现、服务链路跟踪等

请先阅读hyperf文档 grpc服务一节 https://hyperf.wiki/3.0/#/zh-cn/grpc

引用

composer require crayoon/hyperf-grpc-client

生成配置文件

// 若有引用 crayoon/hyperf-grpc 请使用crayoon/hyperf-grpc发布配置
// php bin/hyperf.php vendor:publish crayoon/hyperf-grpc
// 否则
php bin/hyperf.php vendor:publish crayoon/hyperf-grpc-client

使用

// 客户端 继承 \Crayoon\HyperfGrpcClient\BaseGrpcClient 即可
class GoodsClient extends \Crayoon\HyperfGrpcClient\BaseGrpcClient {
    ...
}

DTM

兼容dtm通过服务发现负载调用服务

请先阅读hyperf文档 DTM一节 https://hyperf.wiki/3.0/#/zh-cn/distributed-transaction

// 引入
composer require dtm/dtm-client
// 发布配置
php bin/hyperf.php vendor:publish dtm/dtm-client

修改 config/dependencies.php

return [
    // 加入下面两个映射
    \DtmClient\Api\GrpcApi::class => \Crayoon\HyperfGrpcClient\DTM\GrpcApi::class,
    \Crayoon\HyperfGrpcClient\GrpcClientManager::class => \Crayoon\HyperfGrpcClient\DTM\GrpcClientManagerWithDtmClient::class,
];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-05