phptars/tars-registry
Composer 安装命令:
composer require phptars/tars-registry
包简介
tars的php主控寻址相关
README 文档
README
Module description
The tar registry service of the tar s platform provides the function of service discovery.
This module provides PHP with the ability of master addressing (service discovery).
Document description:
├── composer.json
├── src
│ ├── client //Client code requesting the master service
│ │ ├── Code.php
│ │ ├── CodeRegistry.php
│ │ ├── CommunicatorConfig.php
│ │ ├── CommunicatorFactory.php
│ │ ├── Communicator.php
│ │ ├── CommunicatorRegistry.php
│ │ ├── Consts.php
│ │ ├── RequestPacket.php
│ │ ├── RequestPacketRegistry.php
│ │ ├── ResponsePacket.php
│ │ ├── ResponsePacketRegistry.php
│ │ ├── TUPAPIWrapper.php
│ │ └── TUPAPIWrapperRegistry.php
│ ├── EndpointF.php //struct EndpointF 的php类
│ ├── QueryFServant.php //Direct request for master service
│ ├── QueryFWrapper.php //The priority is to find the service address from memory, and then from the master address
│ ├── RouteTable.php //Save the service address in the swoole table
│ └── tars //Protocol file
│ ├── EndpointF.tars
│ └── QueryF.tars
└── tests
└── demo.php
Use example:
//从tarsregistryService search service address
$wrapper = new \Tars\registry\QueryFWrapper("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890",1,60000);
$result = $wrapper->findObjectById("PHPTest.PHPServer.obj");
var_dump($result);
//The priority is to find the service address from memory, and then from the master address
\Tars\registry\RouteTable::getInstance();
$result = \Tars\registry\RouteTable::getRouteInfo("PHPTest.PHPServer.obj");
echo "result:\n";
var_dump($result);
Changelog
v0.1.7 (2019-03-20)
- Master addressing cache interface, convenient to customize cache mode, default to use swoole table
phptars/tars-registry 适用场景与选型建议
phptars/tars-registry 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.65k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 phptars/tars-registry 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phptars/tars-registry 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-09-11