1 Star 0 Fork 0

TarsPHP / tars-registry

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

主控寻址的模块

1、模块说明

	tars平台的tarsregistry服务提供服务发现的功能。
        本模块为php提供主控寻址的能力(服务发现)。

2、文件说明:

├── composer.json
├── src
│   ├── client  //请求主控服务的client代码
│   │   ├── 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   //直接请求主控服务
│   ├── QueryFWrapper.php   //优先从内存寻找服务地址,其次从主控寻址
│   ├── RouteTable.php      //在swoole table里保存服务地址
│   └── tars   //协议文件             
│       ├── EndpointF.tars 
│       └── QueryF.tars 
└── tests
    └── demo.php

3、使用示例:

        //从tarsregistry服务寻找服务地址
        $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);

        //优先从内存寻找服务地址,其次从主控寻址
        \Tars\registry\RouteTable::getInstance();
        $result = \Tars\registry\RouteTable::getRouteInfo("PHPTest.PHPServer.obj");
        echo "result:\n";
        var_dump($result);

4. Changelog

v0.1.7 (2019-03-20)

  • 主控寻址缓存接口化,方便自定义缓存方式,默认使用swoole table

空文件

简介

暂无描述 展开 收起
PHP
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/TarsPHP/tars-registry.git
git@gitee.com:TarsPHP/tars-registry.git
TarsPHP
tars-registry
tars-registry
master

搜索帮助