Tornado的异步JSON-RPC客户端
jsonrpc_tornado的Python项目详细描述
龙卷:龙卷框架 ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `/>` ` ` ` ` `=====================================================================================================>主要功能3.4 compatible
*公开tornado.httpclient选项
*非阻塞I/O
*支持嵌套的名称空间(如app.users.getusers()`)
install
----
pip install git+https://github.com/artemmus/jsonrpc\u tornado.git
用法
----
同步示例:
代码块::python
from jsonrpc_tornado import jsonrpc server
from tornado.http client import httpclient
def fetch(server_url):
server=jsonrpcserver(server_url,http_client=httpclient,
请求超时=5.0)
代码块::python
在服务器上
result=yield server.foo(1,2)
除了protocolerror as err:
日志记录。error('some rpc error%s,%s',err.code,err)
除了transporterror as err:
err.args[1]引用相应的httperror
日志记录。error('transport error%s',错误参数[1])
todo
----
*测试
credits
----
>基于“jsonrpc”请求lt;http://github.com/gciotta/jsonrpc requests>;`giuseppe ciotta<;gciotta@gmail.com>;`。
*公开tornado.httpclient选项
*非阻塞I/O
*支持嵌套的名称空间(如app.users.getusers()`)
install
----
pip install git+https://github.com/artemmus/jsonrpc\u tornado.git
用法
----
同步示例:
代码块::python
from jsonrpc_tornado import jsonrpc server
from tornado.http client import httpclient
def fetch(server_url):
server=jsonrpcserver(server_url,http_client=httpclient,
请求超时=5.0)
代码块::python
在服务器上
result=yield server.foo(1,2)
除了protocolerror as err:
日志记录。error('some rpc error%s,%s',err.code,err)
除了transporterror as err:
err.args[1]引用相应的httperror
日志记录。error('transport error%s',错误参数[1])
todo
----
*测试
credits
----
>基于“jsonrpc”请求lt;http://github.com/gciotta/jsonrpc requests>;`giuseppe ciotta<;gciotta@gmail.com>;`。