phptars / tars-registry
tars的php主控寻址相关
Installs: 11 522
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 2
Open Issues: 1
Requires
- php: >=5.6
- phptars/tars-utils: ~0.1
This package is auto-updated.
Last update: 2024-10-21 01:37:40 UTC
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