Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
grpclib: pure-Python gRPC implementation
Search
Vladimir Magamedov
April 28, 2018
Programming
550
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
57
Microservices / gRPC
vmagamedov
1
440
High Performance SQLAlchemy
vmagamedov
5
900
Other Decks in Programming
See All in Programming
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
100
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
350
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.2k
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
270
一人だけ、Kiroが静止する日
hideg
0
140
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
430
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
30
13k
FreeBSDでZabbixを動かす
kenkino
0
340
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
170
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
240
Webの地図
yosuke_furukawa
PRO
6
5k
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
380
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
A Soul's Torment
seathinner
8
3.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Embracing the Ebb and Flow
colly
88
5.2k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
A Tale of Four Properties
chriscoyier
163
24k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
340
Making Projects Easy
brettharned
120
6.8k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
290
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)
;-)