Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
grpclib: pure-Python gRPC implementation
Search
Vladimir Magamedov
April 28, 2018
Programming
540
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
grpclib: pure-Python gRPC implementation
Vladimir Magamedov
April 28, 2018
More Decks by Vladimir Magamedov
See All by Vladimir Magamedov
Microservices
vmagamedov
0
50
Microservices / gRPC
vmagamedov
1
430
High Performance SQLAlchemy
vmagamedov
5
900
Other Decks in Programming
See All in Programming
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
110
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
720
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
270
メールのエイリアス機能を履き違えない
isshinfunada
0
230
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
390
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
110
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
220
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
100
What's New in Android 2026
veronikapj
0
260
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
520
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
AIが無かった頃の素敵な出会いの話
codmoninc
1
410
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
119
120k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
170
New Earth Scene 8
popppiees
3
2.5k
The Language of Interfaces
destraynor
162
27k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
510
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
930
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Producing Creativity
orderedlist
PRO
348
40k
Transcript
grpclib @vmagamedov, Evo
HTTP/2 protocol • Binary • Multiplexing • Bidirectional streams •
Flow control • Headers compression
gRPC protocol = HTTP/2 + • Deadlines • Cancellation •
Metadata (extensibility) • Declarative service definition language (.proto files) • Binary messages encoding (protobuf by default) • Streaming requests and responses • Authentication, Introspection, Load balancing x2
gRPC request: HEADERS :method = POST :scheme = http :path
= /cafe.CoffeeMachine/MakeLatte :authority = cafe.svc:50051 content-type = application/grpc+proto te = trailers DATA ... length-prefixed message(s) ... DATA
gRPC response: HEADERS :status = 200 content-type = application/grpc+proto DATA
... length-prefixed message(s) ... DATA HEADERS # trailers grpc-status = 0 # OK
• grpcio by Google • Python 2.7, >=3.4 • threads
• C++ based core: server and client • grpclib by Me & contributors • Python >= 3.5 • async/await • pure-Python, based on awesome hyper-h2 project
Definition syntax = "proto3"; package helloworld; service Greeter { rpc
SayHello (HelloRequest) returns (HelloReply) {} } message HelloRequest { string name = 1; } message HelloReply { string message = 1; }
class Greeter(GreeterBase): async def SayHello(self, stream): request = await stream.recv_message()
message = 'Hello, {}!'.format(request.name) await stream.send_message(HelloReply(message=message)) server = Server([Greeter()], loop=loop) loop.run_until_complete(server.start('127.0.0.1', 50051)) Server
channel = Channel('greeter.svc', 50051, loop=loop) stub = GreeterStub(channel) async def
make_request(): response = await stub.SayHello(HelloRequest(name='World')) assert response.message == 'Hello, World!' Client
None
pip3 install grpclib Have fun! Come work with us (Evo)
;-)