July 2017
Beginner to intermediate
358 pages
10h 54m
English
The beauty of gRPC is the code generation. From the simple proto files that we looked at in Chapter 2, Designing a Great API, we can generate all our client and server code. All we then have to do is to wire up our handlers, which will deal with the business logic.
If we take a look at the proto file in chapter4/grpc/proto/kittens.proto, we can see that the file is somewhat similar to the one we reviewed in a previous chapter.
The main difference is the following block from line 13:
13 service Kittens { 14 rpc Hello(Request) returns (Response) {} 15 }
This is our service definition, which contains the contract for our handlers. It is nicely semantic and very readable, even though it is written in the proto DSL.
To generate ...
Read now
Unlock full access