Files
grpc/examples/python/data_transmission
Sergii Tkachenko b04d3821d4 [CI] Bump pylint to 2.17.7 (#40169)
In preparation for migrating it from python3.7 to python3.11.
Pylint version had to be upgraded because pylint==2.2.2 doesn't support python 3.11.

The image will be updated separately to remove compiling python3.7 from source in #40139.

Pylint v2.17.7 docs: https://pylint.readthedocs.io/en/v2.17.7

Closes #40169

PiperOrigin-RevId: 783026287
2025-07-14 13:45:05 -07:00
..
2019-10-01 05:13:33 +08:00
2025-07-14 13:45:05 -07:00

Data transmission demo for using gRPC in Python

Four ways of data transmission when gRPC is used in Python. Official Guide

  • unary-unary

    In a single call, the client can only send request once, and the server can only respond once.

    client.py: simple_method

    server.py: SimpleMethod

  • stream-unary

    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.

    client.py: client_streaming_method

    server.py: ClientStreamingMethod

  • unary-stream

    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.

    client.py: server_streaming_method

    server.py: ServerStreamingMethod

  • stream-stream

    In a single call, both client and server can send and receive data to each other multiple times.

    client.py: bidirectional_streaming_method

    server.py: BidirectionalStreamingMethod