SlideShare a Scribd company logo
1 of 30
gevent + protobuf = abu.rpc 基于协程的 RPC 实现 赖勇浩 http://laiyonghao.com http://techparty.org 2011.5.14
升级版
RPC
RPC ,[object Object],[object Object],[object Object],[object Object]
abu.rpc
特性 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
google protobuf
Jeff Dean, Google fellow ,[object Object],[object Object]
google protobuf ,[object Object],[object Object],[object Object],[object Object]
Quick Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Quick Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Quick Example ,[object Object],[object Object],[object Object]
gevent
greenlet + libevent
greenlet ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PEP 342 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
libevent ,[object Object],[object Object]
Examples
echo
echo.proto ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
s_echo.py ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
c_echo.py ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
chat room
chat.proto ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],chat.proto ,[object Object],[object Object],[object Object],[object Object],[object Object]
s_chat.py:ChatServerService.hello ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
s_chat.py:ChatServerService.say ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
c_chat.py:ChatClientService.say ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
Thx~ twitter.com/laiyonghao weibo.com/gzlaiyonghao

More Related Content

What's hot

15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix
chinkshady
 
Unit 6
Unit 6Unit 6
Unit 6
siddr
 
Using Unix
Using UnixUsing Unix
Using Unix
Dr.Ravi
 

What's hot (20)

Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
 
vertexdb
vertexdbvertexdb
vertexdb
 
Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To Groovy
 
15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix
 
Lowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost PortablyLowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost Portably
 
pyconjp2015_talk_Translation of Python Program__
pyconjp2015_talk_Translation of Python Program__pyconjp2015_talk_Translation of Python Program__
pyconjp2015_talk_Translation of Python Program__
 
Austin Bingham. Python Refactoring. PyCon Belarus
Austin Bingham. Python Refactoring. PyCon BelarusAustin Bingham. Python Refactoring. PyCon Belarus
Austin Bingham. Python Refactoring. PyCon Belarus
 
C 檔案輸入與輸出
C 檔案輸入與輸出C 檔案輸入與輸出
C 檔案輸入與輸出
 
Unit 6
Unit 6Unit 6
Unit 6
 
Go. Why it goes
Go. Why it goesGo. Why it goes
Go. Why it goes
 
faastCrystal
faastCrystalfaastCrystal
faastCrystal
 
Design Concept of a Lightweight Runtime Environment for Robot Software Compo...
Design Concept of a LightweightRuntime Environment for Robot SoftwareCompo...Design Concept of a LightweightRuntime Environment for Robot SoftwareCompo...
Design Concept of a Lightweight Runtime Environment for Robot Software Compo...
 
Learning Python from Data
Learning Python from DataLearning Python from Data
Learning Python from Data
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
File handling in C
File handling in CFile handling in C
File handling in C
 
Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++
 
Using Unix
Using UnixUsing Unix
Using Unix
 
source code which create file and write into it
source code which create file and write into itsource code which create file and write into it
source code which create file and write into it
 
Qt Translations
Qt TranslationsQt Translations
Qt Translations
 
SymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesSymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performances
 

Similar to abu.rpc intro

Rockin' Protobuf in Ruby
Rockin' Protobuf in RubyRockin' Protobuf in Ruby
Rockin' Protobuf in Ruby
BJ Neilsen
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
Fan Robbin
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
Johnny Pork
 

Similar to abu.rpc intro (20)

Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
 
End-to-end Streaming Between gRPC Services Via Kafka with John Fallows
End-to-end Streaming Between gRPC Services Via Kafka with John FallowsEnd-to-end Streaming Between gRPC Services Via Kafka with John Fallows
End-to-end Streaming Between gRPC Services Via Kafka with John Fallows
 
gRPC - czyli jak skutecznie rozmawiać (rg-dev#14)
gRPC - czyli jak skutecznie rozmawiać (rg-dev#14)gRPC - czyli jak skutecznie rozmawiać (rg-dev#14)
gRPC - czyli jak skutecznie rozmawiać (rg-dev#14)
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 
Rpi python web
Rpi python webRpi python web
Rpi python web
 
Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)
 
Rockin' Protobuf in Ruby
Rockin' Protobuf in RubyRockin' Protobuf in Ruby
Rockin' Protobuf in Ruby
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
 
gRPC & Kubernetes
gRPC & KubernetesgRPC & Kubernetes
gRPC & Kubernetes
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 

More from 勇浩 赖

Behavior+tree+ai lite
Behavior+tree+ai liteBehavior+tree+ai lite
Behavior+tree+ai lite
勇浩 赖
 
敏捷网游架构与性能的新玩法
敏捷网游架构与性能的新玩法敏捷网游架构与性能的新玩法
敏捷网游架构与性能的新玩法
勇浩 赖
 
03 -黄朝兴--腾讯游戏
03 -黄朝兴--腾讯游戏03 -黄朝兴--腾讯游戏
03 -黄朝兴--腾讯游戏
勇浩 赖
 
06 -甄焱琨--知识转化为资源
06 -甄焱琨--知识转化为资源06 -甄焱琨--知识转化为资源
06 -甄焱琨--知识转化为资源
勇浩 赖
 
如何做好沙龙演讲
如何做好沙龙演讲如何做好沙龙演讲
如何做好沙龙演讲
勇浩 赖
 

More from 勇浩 赖 (20)

论 Python 与设计模式。
论 Python 与设计模式。论 Python 与设计模式。
论 Python 与设计模式。
 
一种多屏时代的通用 web 应用架构
一种多屏时代的通用 web 应用架构一种多屏时代的通用 web 应用架构
一种多屏时代的通用 web 应用架构
 
Tp web
Tp webTp web
Tp web
 
2012,我的技术之选
2012,我的技术之选2012,我的技术之选
2012,我的技术之选
 
页游开发中的 Python 组件与模式
页游开发中的 Python 组件与模式页游开发中的 Python 组件与模式
页游开发中的 Python 组件与模式
 
Scala
ScalaScala
Scala
 
珠三角技术沙龙广州场
珠三角技术沙龙广州场珠三角技术沙龙广州场
珠三角技术沙龙广州场
 
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?
 
Python 于 webgame 的应用
Python 于 webgame 的应用Python 于 webgame 的应用
Python 于 webgame 的应用
 
Behavior+tree+ai lite
Behavior+tree+ai liteBehavior+tree+ai lite
Behavior+tree+ai lite
 
敏捷网游架构与性能的新玩法
敏捷网游架构与性能的新玩法敏捷网游架构与性能的新玩法
敏捷网游架构与性能的新玩法
 
先用再学 - 借助 Xna 快速开发游戏原型
先用再学  - 借助 Xna 快速开发游戏原型先用再学  - 借助 Xna 快速开发游戏原型
先用再学 - 借助 Xna 快速开发游戏原型
 
关于Bitworld的一些话题222
关于Bitworld的一些话题222关于Bitworld的一些话题222
关于Bitworld的一些话题222
 
Stekin
StekinStekin
Stekin
 
03 -黄朝兴--腾讯游戏
03 -黄朝兴--腾讯游戏03 -黄朝兴--腾讯游戏
03 -黄朝兴--腾讯游戏
 
06 -甄焱琨--知识转化为资源
06 -甄焱琨--知识转化为资源06 -甄焱琨--知识转化为资源
06 -甄焱琨--知识转化为资源
 
07 -林伟铃--成长中的36氪
07 -林伟铃--成长中的36氪07 -林伟铃--成长中的36氪
07 -林伟铃--成长中的36氪
 
01 -阿朱--简单事情夯实做
01 -阿朱--简单事情夯实做01 -阿朱--简单事情夯实做
01 -阿朱--简单事情夯实做
 
Python 温故
Python 温故Python 温故
Python 温故
 
如何做好沙龙演讲
如何做好沙龙演讲如何做好沙龙演讲
如何做好沙龙演讲
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

abu.rpc intro