项目作者: findsomething

项目描述 :
swoole + yar + tcp
高级语言: PHP
项目地址: git://github.com/findsomething/syar.git
创建时间: 2017-01-12T15:04:58Z
项目社区:https://github.com/findsomething/syar

开源协议:

下载


syar

说明

  1. 用swoole+yar实现了一个简单的rpc调用 目前只实现了单次调用(数据解析部分借鉴了https://github.com/stcer/syar thx)
  2. tcp 初步实现了一个类似的rpc调用

使用方法

  • 启动服务端:
    bin/server run|start|stop|restart config/server.php

  • 启动带tcp与http的服务端 :
    bin/server run|start|stop|restart config/multi-server.php

测试

http

  1. $client = new \Yar_client("http://127.0.0.1:9503/?service=TestService");
  2. $params = array('hello' => 'world');
  3. $result = $client->giveBack($params);

tcp

  1. $client = new \FSth\SYar\Client\Client('127.0.0.1', '9504', 'TestService');
  2. $result = $client->giveBack(['hello' => 'world']);

changelog

  • 2017-03-17 v0.1.4

    1. add rpc with tcp protocol
  • 2017-05-15 v0.2.0

    1. add cmd Ø
  • 2017-07-06 v0.3.0

    1. add zipKin support