Using the gRPC AsyncIO API in python

2,599 views
Skip to first unread message

Nishit Mengar

unread,
Nov 30, 2021, 2:46:26 PM11/30/21
to grpc.io
Hello,
I apologize in advance if it is a dumb question, but I was wondering how can I do something like stream.write() or stream.read() in bidirectional streaming in python where I want to asynchronously call these.

The official gRPC Python AsyncIO API documentation only has abstract methods in the classes. Does this mean that I actually have to (override) implement the methods myself? How do I actually get the context to correctly configure a class like grpc.aio.StreamStreamCall() ? (Apologies again if it is a dumb question, I'm a beginner to this and development in general)

Lidi Zheng

unread,
Dec 1, 2021, 2:47:22 PM12/1/21
to grpc.io
Hi,

Here is an unit test case using stream.write() and stream.read() to communicate in bidirectional streaming: https://github.com/grpc/grpc/blob/master/src/python/grpcio_tests/tests_aio/unit/channel_test.py#L180

Sorry that we didn't have an example to demonstrate this usage.

Mark Bearden

unread,
Feb 11, 2022, 5:37:10 PM2/11/22
to grpc.io
Is there any available example of implementing the server side of an async bidirectional-streaming service method, using grpc.aio?   If I followed the link to the unit test correctly, then it only shows a client for the call that is in python.   Looks like the code for the server side (Grpc.Testing.TestService class) is C#.

Lidi Zheng

unread,
Feb 16, 2022, 2:11:51 PM2/16/22
to grpc.io
Reply all
Reply to author
Forward
0 new messages