From the course: Effective Serialization with Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

gRPC

gRPC - Python Tutorial

From the course: Effective Serialization with Python

Start my 1-month free trial

gRPC

- [Instructor] Once you serialize data, you need some way to pass it along. When one service talks to another, the common way is to use HTTP. gRPC is a serialization and communication protocol. It passes messages in Protocol Buffers format, and uses HTTP two as the communication protocol. Here is our weather.proto file. We added an AddReply message, and we added a weather service. The weather service has one method saying AddTemperature to the database. It gets a parameter of temperature and returns an AddReply, which tells us how many records are there in the database. To work with gRPC in Python, you need to install the grpcio tools package. So Python-m pip, install gprcio minus tools. And now we need to generate the binding. This is a long command. So I'm going to copy and paste it, in order to make sure I don't make any mistakes. Let's break this command two parts. Python-m grpc tools.protoc, is running the command.…

Contents