fsth/syar

基于 worker 的 yar

v0.3.5 2017-12-04 15:11 UTC

This package is auto-updated.

Last update: 2024-09-14 20:55:59 UTC


README

说明

  1. 使用 swoole 和 yar 实现了一个简单的 RPC 调用,目前只实现了单次调用(数据解析部分借鉴了https://github.com/stcer/syar 感谢)
  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

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

tcp

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

变更日志

  • 2017-03-17 v0.1.4
add rpc with tcp protocol
  • 2017-05-15 v0.2.0
add cmd Ø
  • 2017-07-06 v0.3.0
add zipKin support