一、前言
假定已对protobuf的语法有了一定的了解,若无,需自行学习。
需要已经完成protoc的安装。
本文基本参考gRPC官方文档,作为学习过程的记录。
二、参考
Protobuf Google官方文档https://developers.google.com/protocol-buffers/docs/overview)
Google官方文档https://grpc.io/docs/
gRPC 官方文档中文版https://doc.oschina.net/grpc?t=56831
三、Python
环境搭建
- 官方Github链接https://github.com/grpc/grpc.git
本地git clone或直接下载
git clone https://github.com/grpc/grpc.git - 相关库安装
pip install grpcio grpcio-tools protobuf
若失败,可能与pip版本有关
完成后可以运行已经写好的例程进行检验,目录为grpc-master/examples/python/helloworld,先运行服务器端
python greeter_