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
5 years on air - Andrii Bereza
Search
GDG Cherkasy
December 16, 2017
69
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
5 years on air - Andrii Bereza
Grpc Introduction
GDG Cherkasy
December 16, 2017
More Decks by GDG Cherkasy
See All by GDG Cherkasy
Трансформація від розробника до ліда: байки та поради.
gdgcherkasy
0
150
Емоції: усвідомлення, прийняття, комунікація
gdgcherkasy
0
140
Kibana Plugin Development - Vlad Bolibruk
gdgcherkasy
0
90
“Why JS is way to go for backend”
gdgcherkasy
0
91
CoreData, custom merge policy
gdgcherkasy
2
1.6k
macOS_for_iOS_devs2.pdf
gdgcherkasy
0
87
MQTT.pdf
gdgcherkasy
1
53
Инструменты Lean Product Management как точки пересечения проектов с "реальностью": хватит клонировать плохие решения!
gdgcherkasy
1
91
Насколько силен Иммунитет вашей организации?
gdgcherkasy
1
120
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
160
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
230
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Balancing Empowerment & Direction
lara
6
1.2k
Facilitating Awesome Meetings
lara
57
7k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
430
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Crafting Experiences
bethany
1
180
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
470
Transcript
None
gRPC
1. 2. 3.
★ ★ ★ ★ { "id": 1, "name": "Solaire of
Astora", "description": "Praise The gRPC!", "hollow": null }
gRPC
gRPC
gRPC
➢ ➢ ➢ ➢ gRPC
UI Logging Data Service Data Source 1 Data Source 2
gRPC
None
★ ★ ★ ★
gRPC
None
Describe (.proto) Implement (Server) Invoke (Client) Generate Code
message User { int32 id = 1; string name =
2; bool administrator = 3; } message name property type property name property index gRPC
service HelloService { rpc Hello(HelloRequest) returns (HelloResponse); } message HelloRequest
{ string name = 1; } message HelloResponse { string response = 1; } service name service method request type response type gRPC
None
class HelloService: HelloServiceImplBase() { } override fun hello(request: HelloRequest, responseObserver:
StreamObserver<HelloResponse>) { } responseObserver.onNext( HelloResponse.newBuilder() .setResponse("Hello, " + request.name) .build() ) responseObserver.onCompleted()
NettyServerBuilder.forPort(4444) .addService(HelloService()) .build() .start()
val channel = ManagedChannelBuilder.forAddress("localhost", 4444) .build(); val request = HelloRequest.newBuilder()
.setName("WALL-E") .build() val response = HelloServiceGrpc.newBlockingStub(channel) .hello(request) HelloServiceGrpc.newStub(channel) .hello(request, object: StreamObserver<HelloResponse> { override fun onNext(value: HelloResponse?) { println("I'm not alone!") } override fun onError(t: Throwable?) {} override fun onCompleted() {} })
None
➢ ➢ ➢
• • •
gRPC
• • • • • •