![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
GRPC
我就是我,不一样的烟火
这个作者很懒,什么都没留下…
展开
-
grpc-python03-常用protobuf数据类型和pb文件
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!"""Client and server classes corresponding to protobuf-defined services."""import grpcimport hello_word_pb2 as h...原创 2021-12-17 21:34:02 · 1053 阅读 · 0 评论 -
grpc-python04 流传输
1.unary 单程2.stream:双向 客户端(流)<-> 服务器端 send(流)双方建立长链接,一方向另外一方推流的数据:单向 客户端(流)<-> 服务器端(非流)单向 客户端(非流)<-> 服务器端 send(流)服务器端向客户端推流数据proto:service SayHello { rpc ...原创 2021-12-17 21:09:46 · 439 阅读 · 0 评论 -
grpc-python06–headers与压缩与传输最大值
添加header信息service -> clientservice:context.set_trailing_metadata((("x-envoy-decorator-operation", "test"), ("name", "donghao"), ("age", "23")))client:resp, call = client.HelloDongha...原创 2021-12-17 12:57:32 · 312 阅读 · 0 评论 -
grpc-python02–了解rpc与grpc以及创建一个简单的grpc-python
原创 2021-12-17 10:46:47 · 257 阅读 · 0 评论 -
grpc-python07—拦截器 & 多进程
书写拦截器调用链路、身份验证init code、detail错误函数 grpc_code、abortintercept_service(self, continuation, header_call_details)def _abort(code, details): # unary, streamdef terminate(ignored_request, c...原创 2021-12-17 03:00:50 · 350 阅读 · 0 评论 -
grpc-python01–引言
pip install grpcio grpcio_tools protobuf1.定义protobuf文件// 语法syntax = "proto3";// 包名package test;// service定义service SayHello { // 定义方法、请求、响应message rpc HelloDonghao (HelloDonghao...原创 2021-12-17 02:31:04 · 1097 阅读 · 0 评论 -
GRPC hello
GRPCremote procedure call 远程过程调用,使用的时候客户端调用server端提供的接口就像是调用本地的函数一样。ProtobufProtobuf实际是一套类似Json或者XML的数据传输格式和规范,用于不同应用或进程之间进行通信时使用。通信时所传递的信息是通过Protobuf定义的message数据结构进行打包,然后编译成二进制的码流再进行传输或者存储步骤:1....原创 2020-02-17 16:42:00 · 156 阅读 · 0 评论