Commit Graph

6 Commits

Author SHA1 Message Date
Sreenithi Sridharan
7ff0c56ebd Added Python Example for Flow Control (#37044)
Have added the required client, server, proto and proto generated files.
The design of the example is as follows:

1. The client sends a bulk amount of data(approx. 2 KB in each
iteration) to the server in a streaming call.
2. The server applies back-pressure by delaying reading of the requests,
which makes the client pause sending requests after around 64KB
3. The client then resumes sending requests only after the server reads
a few requests and clears the buffer.

By adding print statements on data send/receive on both client and
server side, the client pausing/resuming requests can be seen clearly.
The client and server logs can be seen below:

**Client Logs**
```
Request 10: Sent 20000 bytes in total
Request 20: Sent 40000 bytes in total
Request 30: Sent 60000 bytes in total
Request 40: Sent 80000 bytes in total
Received 10 responses

Request 50: Sent 100000 bytes in total
Received 20 responses

Request 60: Sent 120000 bytes in total
Received 30 responses

Request 70: Sent 140000 bytes in total
Received 40 responses

Request 80: Sent 160000 bytes in total
Received 50 responses

Request 90: Sent 180000 bytes in total
Received 60 responses

Request 100: Sent 200000 bytes in total
Received 70 responses

Received 80 responses

Received 90 responses

Received 100 responses
```

**Server Logs**
```
Server started, listening on 50051
Request 10: Received 20000 bytes in total
Request 10: Sent 20000 bytes in total

Request 20: Received 40000 bytes in total
Request 20: Sent 40000 bytes in total

Request 30: Received 60000 bytes in total
Request 30: Sent 60000 bytes in total

Request 40: Received 80000 bytes in total
Request 40: Sent 80000 bytes in total

Request 50: Received 100000 bytes in total
Request 50: Sent 100000 bytes in total

Request 60: Received 120000 bytes in total
Request 60: Sent 120000 bytes in total

Request 70: Received 140000 bytes in total
Request 70: Sent 140000 bytes in total

Request 80: Received 160000 bytes in total
Request 80: Sent 160000 bytes in total

Request 90: Received 180000 bytes in total
Request 90: Sent 180000 bytes in total

Request 100: Received 200000 bytes in total
Request 100: Sent 200000 bytes in total
```
2024-07-02 21:49:39 -07:00
Xuan Wang
80f3a90556 [Python O11Y] Add observability example (#35637)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2024-01-25 10:04:06 -08:00
Xuan Wang
49d48c94ab [Python Example] Fix compression example (#34745)
Fix: https://github.com/grpc/grpc/issues/34690

Also added generated proto files to example folder so we can run example
directly.
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-10-20 09:10:14 -07:00
Xuan Wang
a190831789 Add examples for timeout, kepp_alive, reflection and health_checking (#32243)
* Add timeout example

* Add pb2 file to example

* Remove .proto file

* Add keep_alive example

* Add refelction client

* fixes

* Add example for health_check

* Changes based on comments

* Fix pylint
2023-02-03 14:11:27 -08:00
Richard Belleville
d175c79935 Add lb policy example (#32256)
* Add lb policy example

* Update copyright

* This is Python 3

* Fix isort
2023-02-03 09:58:50 -08:00
Yash Tibrewal
41ec08c69a Update third_party/protobuf to 3.21.4 (#30377)
* Update third_party/protobuf

* run tools/distrib/python/make_grpcio_tools.py

* regenerate protos for ruby, php

* update build_handwritten.yaml

* regenerate projects

* Build - Use :well_known_type_protos instead of :well_known_protos

* Fix target

* Update upb

* Update Python for Protobuf 4.21 (#140)

* Update protobuf dependency on grpcio-tools

* Off by one

* Drop python 3.6 support

* Try upgrading pip

* And in the other script

* Try to figure out if we're compatible with abi3

* See what we've already got installed

* Update the requirements.txt file I didn't know existed

* And here too

* See what's installed

* Let's try that again

* Remove

* Try to confirm version

* Let me see the generated code

* Fix non-Bazel test runner

* Work for all test directories

* Regenerate example protos

* Clean up

* Generate .pyi files

* Fix type checking and linting

* Exclude pyi files from isort

* Upgrade to 3.21.4

* Update iwyu to get around messy protobuf IWYU rules

Co-authored-by: Richard Belleville <gnossen@gmail.com>
2022-08-04 09:39:49 -07:00