- 授权协议: 未知
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/Eleme/thriftpy
- 软件文档: https://thriftpy.readthedocs.org/en/latest/
软件介绍
ThriftPy 是 Apache Thrift 的 Python 语言移植版本。
服务器端示例代码:
import thriftpy
from thriftpy.rpc import make_server
pingpong = thriftpy.load("pingpong.thrift")
class Dispatcher(object):
def ping(self):
return "pong"
server = make_server(pingpong.PingPong, Dispatcher(), '127.0.0.1', 6000)
server.serve()
客户端:
import thriftpy
from thrift.rpc import make_client
pingpong = thriftpy.load("pingpong.thrift")
client = make_client(pingpong.PingPong, '127.0.0.1', 6000)
client.ping()
