Home > Backend Development > PHP Tutorial > PHP的RPC框架:Dora RPC

PHP的RPC框架:Dora RPC

WBOY
Release: 2016-06-20 12:54:42
Original
1160 people have browsed it

Dora RPC 是一款基础于Swoole定长包头通讯协议的最精简的RPC。

  • 此RPC基础于Swoole定长包头通讯协议的最精简的RPC

  • 支持并发\单调,异步\同步

  • 目前只提供PHP语言版本,后续还会根据使用建议逐渐迭代

  • 可以很方便快速的搭建后端应用服务器

  • 此开源用于快速实现RPC的基础,根据需要进行调配,用于PHP前后端服务器间RPC

  • 后续将配套中间件及服务降级

  • 基础swoole,性能较好可供大中型网站使用

客户端代码:

$obj = new DoraRPCClient();for ($i = 0; $i < 100000; $i++) {    #single    $ret = $obj->singleAPI("abc", array(234, $i), true);    var_dump($ret);    #multi    $data = array(        "oak" => array("name" => "oakdf", "param" => array("dsaf" => "321321")),        "cd" => array("name" => "oakdfff", "param" => array("codo" => "fds")),    );    $ret = $obj->multiAPI($data, false);    var_dump($ret);}
Copy after login

服务器端:

$server = new DoraRPCServer();//这里必须是DoraRPCServer继承类并实现dowork才可以工作
Copy after login

项目主页:http://www.open-open.com/lib/view/home/1434011480176

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template