Json-RPC 的 PHP 扩展 php-JsonRPC

码农软件 · 软件分类 · JSON/BSON开发包 · 2019-03-31 06:29:44

软件介绍

JsonRPC 2.0 Client and Server
=============================

轻量级 Json-RPC 2.0 客户端和服务端的php扩展,基于 multi_curl + epoll的并发客户端,依据[jsonrpc](http://www.jsonrpc.org/)协议规范。

服务端:

$server = new Jsonrpc_Server();

// style one function variable
$add1 = function($a, $b){
    return $a + $b;
};
$server->register('addition1', $add1);

// style two function string
function add2($a, $b){
  return $a + $b;
}
$server->register('addition2', 'add2');

// style three function closure
$server->register('addition3', function ($a, $b) {
    return $a + $b;
});

//style four class method string
class A 
{
  static public function add($a, $b)
  {
    return $a + $b;
  }
}
$server->register('addition4', 'A::add');

echo $server->execute();

//output >>>
//{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error"}}

客户端:

$client = new Jsonrpc_Client(1);
$client->call('http://localhost/server.php', 'addition1', array(3,5));
$client->call('http://localhost/server.php', 'addition2', array(10,20));
$client->call('http://localhost/server.php', 'addition3', array(2,8));
$client->call('http://localhost/server.php', 'addition4', array(6,15));
/* ... */
$result = $client->execute();

var_dump($result);

//output >>>
/*
array(2) {
  [0]=>
  array(3) {
    ["jsonrpc"]=>
    string(3) "2.0"
    ["id"]=>
    int(110507766)
    ["result"]=>
    int(8)
  }
  [1]=>
  array(3) {
    ["jsonrpc"]=>
    string(3) "2.0"
    ["id"]=>
    int(1559316299)
    ["result"]=>
    int(30)
  }
  ...
}
*/

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

矩阵论

矩阵论

方保镕 / 清华大学出版社 / 2004-1 / 39.00元

本书比较全面、系统地介绍了矩阵的基本理论、方法及其应用。全书分上、下两篇,共10章,分别介绍了线性空间与线性算子,内积空间与等积变换,λ矩陈与若尔当标准形,赋范线性空间与矩阵范数,矩阵的微积分运算及其应用,广义逆矩阵及其应用,矩阵的分解,矩阵的克罗内克积、阿达马积与反积,几类特殊矩阵(如:非负矩阵与正矩阵、循环矩阵与素矩阵、随机矩阵和双随机矩阵、单调矩阵、M矩阵与H矩阵、T矩阵与汉大象尔矩阵等),......一起来看看 《矩阵论》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具