php 通过msgpack-rpc调用python
发布时间:2017-03-28 18:11:38 来源:51推一把
【摘要】实现需求python 提供server端php 通过rpc协议,封装自己的click端去调用python的server端,实现跨平台接口调用。
实现需求
python 提供server端
php 通过rpc协议,封装自己的click端去调用python的server端,实现跨平台接口调用。
#php click
$client = new MessagePackRPC_Client(196.10.10.11, 1985);
$client->call(hello1, array(2));
PS:call方法,第一个是请求的方法名,第二个参数需要以数组方式传进去。
#不同语言的msgpack-rpc
https://github.com/msgpack-rpc
#php的msgpack-rpc
https://github.com/msgpack-rpc/msgpack-rpc-php
#yar框架
https://github.com/laruence/yar
python 提供server端
php 通过rpc协议,封装自己的click端去调用python的server端,实现跨平台接口调用。
#php click
$client = new MessagePackRPC_Client(196.10.10.11, 1985);
$client->call(hello1, array(2));
PS:call方法,第一个是请求的方法名,第二个参数需要以数组方式传进去。
#不同语言的msgpack-rpc
https://github.com/msgpack-rpc
#php的msgpack-rpc
https://github.com/msgpack-rpc/msgpack-rpc-php
#yar框架
https://github.com/laruence/yar