Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An Rpc Demo Using Tornado and Protobuf

NotificationsYou must be signed in to change notification settings

wangzz719/protobuf_http_rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

介绍

protobuf_tornado_rpc 是一个基于 protobuf 和 tornado 的 rpc 框架

  • 框架使用 google protobuf rpc 协议
  • 消息的传输位于 http 层,使用 tornado 作为服务器实现

protobuf 介绍

proto 文件编写规则

proto 文件的编写规则参见:google protobuf

在使用PRC协议时,必须加上option py_generic_services = true;可选项,要不然编译器不会生成包含 connect_server 函数的 Service 描述

编译命令

protoc --python_out={output_dir} {proto_file}

运行 example

  1. 在本项目目录下运行buildout (使用pip install zc.buildout 安装buildout 命令)
  2. 启动 test server,运行命令:bin/python examples/test_service.py
  3. 调用 test server 服务接口,运行命令:bin/python examples/test_client.py

参考

[1]https://github.com/modeswitch/protobuf-rpc

[2]python通过protobuf实现rpc

About

An Rpc Demo Using Tornado and Protobuf

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp