节约用烧瓶的方法…正确的方法
archerv2的Python项目详细描述
archer是一个微型rpc框架,其灵感来源于基于节俭的烧瓶。
弓箭手非常容易使用
保存在hello.py:
fromarcherv2importArcherapp=Archer('PingPong')@app.api('ping')defping():return'pong'
省钱。省钱:
service PingPong { string ping(), }
阿切尔会帮你找到这个旧文件,并且依靠Thriftpy 在运行中生成代码。
而且易于设置
运行它:
$ pip install Archer
$ archerv2 run
* Running on 127.0.0.1:6000/
archer会找到应用程序实例来启动dev服务器,然后重新加载它 当检测到python或thrift文件上的更改时。
快速获得一些反馈
只需运行命令:
$ archerv2 call ping * pong
使用客户端外壳
手拿客户机跳入shell:
$ archerv2 client
>>> client.ping()
很酷,嗯!