phptars/ tars-registry
此包最新版本(0.1.7)没有提供许可证信息。
tars的PHP主控寻址相关
0.1.7
2019-03-20 11:17 UTC
Requires
- php: >=5.6
- phptars/tars-utils: ~0.1
This package is auto-updated.
Last update: 2024-09-21 01:29:38 UTC
README
模块描述
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).
文档描述
├── 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
使用示例
//从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);
变更日志
v0.1.7 (2019-03-20)
- 主控寻址缓存接口,方便自定义缓存模式,默认使用swoole表