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
72
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
150
Kibana Plugin Development - Vlad Bolibruk
gdgcherkasy
0
91
“Why JS is way to go for backend”
gdgcherkasy
0
96
CoreData, custom merge policy
gdgcherkasy
2
1.6k
macOS_for_iOS_devs2.pdf
gdgcherkasy
0
87
MQTT.pdf
gdgcherkasy
1
57
Инструменты Lean Product Management как точки пересечения проектов с "реальностью": хватит клонировать плохие решения!
gdgcherkasy
1
92
Насколько силен Иммунитет вашей организации?
gdgcherkasy
1
120
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
The Cost Of JavaScript in 2023
addyosmani
55
10k
30 Presentation Tips
portentint
PRO
1
340
We Are The Robots
honzajavorek
0
270
Paper Plane
katiecoart
PRO
1
52k
How to make the Groovebox
asonas
2
2.3k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
180
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
The World Runs on Bad Software
bkeepers
PRO
72
12k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
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
• • • • • •