Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
BUILD | H A D | 25-Apr-2025 | 1.2 KiB | 48 | 44 | |
README.cn.md | H A D | 25-Apr-2025 | 1,009 | 37 | 18 | |
README.en.md | H A D | 25-Apr-2025 | 1 KiB | 38 | 19 | |
alts_client.py | H A D | 25-Apr-2025 | 1.3 KiB | 42 | 20 | |
alts_server.py | H A D | 25-Apr-2025 | 1.2 KiB | 41 | 18 | |
client.py | H A D | 25-Apr-2025 | 4.7 KiB | 140 | 79 | |
demo.proto | H A D | 25-Apr-2025 | 3.1 KiB | 70 | 59 | |
demo_pb2.py | H A D | 25-Apr-2025 | 1.5 KiB | 30 | 17 | |
demo_pb2.pyi | H A D | 25-Apr-2025 | 841 | 22 | 18 | |
demo_pb2_grpc.py | H A D | 25-Apr-2025 | 8.2 KiB | 187 | 165 | |
server.py | H A D | 25-Apr-2025 | 4.5 KiB | 128 | 70 |
README.cn.md
1## Data transmission demo for using gRPC in Python 2 3在Python中使用gRPC时, 进行数据传输的四种方式 [官方指南](<https://grpc.io/docs/guides/concepts/#unary-rpc>) 4 5- #### 一元模式 6 7 在一次调用中, 客户端只能向服务器传输一次请求数据, 服务器也只能返回一次响应 8 9 `client.py: simple_method` 10 11 `server.py: SimpleMethod` 12 13- #### 客户端流模式 14 15 在一次调用中, 客户端可以多次向服务器传输数据, 但是服务器只能返回一次响应 16 17 `client.py: client_streaming_method ` 18 19 `server.py: ClientStreamingMethod` 20 21- #### 服务端流模式 22 23 在一次调用中, 客户端只能向服务器传输一次请求数据, 但是服务器可以多次返回响应 24 25 `client.py: server_streaming_method` 26 27 `server.py: ServerStreamingMethod` 28 29- #### 双向流模式 30 31 在一次调用中, 客户端和服务器都可以向对方多次收发数据 32 33 `client.py: bidirectional_streaming_method` 34 35 `server.py: BidirectionalStreamingMethod` 36 37
README.en.md
1## Data transmission demo for using gRPC in Python 2 3Four ways of data transmission when gRPC is used in Python. [Official Guide](<https://grpc.io/docs/guides/concepts/#unary-rpc>) 4 5- #### unary-unary 6 7 In a single call, the client can only send request once, and the server can only respond once. 8 9 `client.py: simple_method` 10 11 `server.py: SimpleMethod` 12 13- #### stream-unary 14 15 In a single call, the client can transfer data to the server an arbitrary number of times, but the server can only return a response once. 16 17 `client.py: client_streaming_method` 18 19 `server.py: ClientStreamingMethod` 20 21- #### unary-stream 22 23 In a single call, the client can only transmit data to the server at one time, but the server can return the response many times. 24 25 `client.py: server_streaming_method` 26 27 `server.py: ServerStreamingMethod` 28 29- #### stream-stream 30 31 In a single call, both client and server can send and receive data 32 to each other multiple times. 33 34 `client.py: bidirectional_streaming_method` 35 36 `server.py: BidirectionalStreamingMethod` 37 38