Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
BUILD | D | 12-May-2024 | 1.3 KiB | 50 | 45 | |
README.cn.md | D | 12-May-2024 | 1,009 | 37 | 18 | |
README.en.md | D | 12-May-2024 | 1 KiB | 38 | 19 | |
alts_client.py | D | 12-May-2024 | 1.3 KiB | 40 | 18 | |
alts_server.py | D | 12-May-2024 | 1.2 KiB | 40 | 17 | |
client.py | D | 12-May-2024 | 4.7 KiB | 124 | 64 | |
demo.proto | D | 12-May-2024 | 3.1 KiB | 70 | 59 | |
demo_pb2.py | D | 12-May-2024 | 5.3 KiB | 175 | 147 | |
demo_pb2_grpc.py | D | 12-May-2024 | 4.5 KiB | 107 | 92 | |
server.py | D | 12-May-2024 | 4.4 KiB | 116 | 58 |
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