创建thrift文件
service Hello {
string get()
}
使用thrift 创建服务需要的组件
thrift --gen py hello.thrift
得到一个gen-py文件,请将该文件放到新建的python项目下面
编写服务端
# coding=utf-8
from thrift_server.gen.hello.Hello import Processor
from thrift_server.gen.hello.ttypes
service Hello {
string get()
}
thrift --gen py hello.thrift
得到一个gen-py文件,请将该文件放到新建的python项目下面
# coding=utf-8
from thrift_server.gen.hello.Hello import Processor
from thrift_server.gen.hello.ttypes