phptars/tars-registry 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

phptars/tars-registry

最新稳定版本:0.1.7

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-09-11