Yar 并行的RPC框架

程序名称:Yar

授权协议: PHP license

操作系统: 跨平台

开发语言: C/C++

Yar 介绍

Yar 是一个支持多种打包协议的, 并行的RPC框架.

它基于HTTP协议, 在libcurl基础上开发而成

简单的Server:

      1.   2. class API {
  3.     /**
  4.      * the doc info will be generated automatically into service info page.
  5.      * @params
  6.      * @return
  7.      */
  8.     public function api($parameter, $option = "foo") {
  9.     }
  10.  
  11.     protected function client_can_not_see() {
  12.     }
  13. }
  14.  
  15. $service = new Yar_Server(new API());
  16. $service->handle();
  17. ?>

简单调用:

      1.   2. $client = new Yar_Client("http://host/api/");
  3. $result = $client->api("parameter);
  4. ?>

并行调用:

      1.   2. function callback($retval, $callinfo) {
  3.      var_dump($retval);
  4. }
  5.  
  6. Yar_Concurrent_Client::call("http://host/api/", "api", array("parameters"), "callback");
  7. Yar_Concurrent_Client::call("http://host/api/", "api", array("parameters"), "callback");
  8. Yar_Concurrent_Client::call("http://host/api/", "api", array("parameters"), "callback");
  9. Yar_Concurrent_Client::call("http://host/api/", "api", array("parameters"), "callback");
  10. Yar_Concurrent_Client::loop(); //send
  11. ?>

更多信息参看: Yar at Github

Yar 官网

https://github.com/laruence/yar

相关编程语言

MuPlayer 是一款跨平台、轻量级的音频播放解决方案,...
OS FLV 是一个 开源和可嵌入网页的flv播放器。 这个...
DewPlayer音乐播放器,样式很简单,而且很实用.播放器...
JW FLV MEDIA PLAYER是一个开源的在网页上使用的Fla...
Speakker 是一个基于 Web 浏览器的音乐播放器,只提...
Player Framework 是一个开源的支持 HTML5 的视频播...