并行的RPC框架 Yar

码农软件 · 软件分类 · RPC/XMLRPC项目 · 2019-04-11 20:56:34

软件介绍

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

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

简单的Server:

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

简单调用:

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

并行调用:

  1. function callback($retval, $callinfo) {
  2.      var_dump($retval);
  3. }
  4.  
  5. Yar_Concurrent_Client::call("http://host/api/", "api", array("parameters"), "callback");
  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::loop(); //send
  10. ?>

更多信息参看: Yar at Github

本文地址:https://codercto.com/soft/d/3376.html

The Smashing Book

The Smashing Book

Jacob Gube、Dmitry Fadeev、Chris Spooner、Darius A Monsef IV、Alessandro Cattaneo、Steven Snell、David Leggett、Andrew Maier、Kayla Knight、Yves Peters、René Schmidt、Smashing Magazine editorial team、Vitaly Friedman、Sven Lennartz / 2009 / $ 29.90 / € 23.90

The Smashing Book is a printed book about best practices in modern Web design. The book shares technical tips and best practices on coding, usability and optimization and explores how to create succes......一起来看看 《The Smashing Book》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具