Daily Log

Daily log 15: gRPC and Social Life

Accord Project

This is something I came across while researching for work and never did I fall in love with an open-source project before. It’s a thing of beauty, everything about it is amazing. I am outta words.

gRPC : Let’s look at what’s the fuss.

In gRPC a client application can directly call methods on a server application on a different machine as if it was a local object, making it easier for you to create distributed applications and service
gRPC clients and servers can run and talk to each other in a variety of environments – from servers inside Google to your own desktop – and can be written in any of gRPC’s supported languages.
 Protocol buffer data is structured as messages, where each message is a small logical record of information containing a series of name-value pairs called fields. Here’s a simple example:
Then, once you’ve specified your data structures, you use the protocol buffer compiler protoc to generate data access classes in your preferred language(s) from your proto definition.
// The greeter service definition.service Greeter {  // Sends a greeting  rpc SayHello (HelloRequest) returns (HelloReply) {}}// The request message containing the user's name.message HelloRequest {  string name = 1;}// The response message containing the greetingsmessage HelloReply {  string message = 1;}
  • On the server side, the server implements the methods declared by the service and runs a gRPC server to handle client calls. The gRPC infrastructure decodes incoming requests, executes service methods, and encodes service responses.
  • On the client side, the client has a local object known as stub (for some languages, the preferred term is client) that implements the same methods as the service. The client can then just call those methods on the local object, wrapping the parameters for the call in the appropriate protocol buffer message type – gRPC looks after sending the request(s) to the server and returning the server’s protocol buffer response(s).
READ  Daily Log: Miss Americana

GRPC : Python 

Installation 

python -m pip install grpcio
python -m pip install grpcio-tools

Gaslighter boi

Turns out I have a social life. Turns out, he reads my blogs. Hi!

Leave a Reply