[Python AIO] Add note for read/write APIs (#35598)

Fix: https://github.com/grpc/grpc/issues/35061

Add note to indicate that iterator and read/write APIs can't be mixed in a single RPC.

<!--

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.

-->

Closes #35598

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35598 from XuanWang-Amos:aio_mix_apis_doc 4c4cfbf06e
PiperOrigin-RevId: 601580411
pull/35671/head
Xuan Wang 10 months ago committed by Copybara-Service
parent ba2f74a84c
commit a73293bf4c
  1. 12
      src/python/grpcio/grpc/aio/_base_call.py

@ -169,6 +169,9 @@ class UnaryStreamCall(
Read operations must be serialized when called from multiple
coroutines.
Note that the iterator and read/write APIs may not be mixed on
a single RPC.
Returns:
A response message, or an `grpc.aio.EOF` to indicate the end of the
stream.
@ -182,6 +185,9 @@ class StreamUnaryCall(
async def write(self, request: RequestType) -> None:
"""Writes one message to the stream.
Note that the iterator and read/write APIs may not be mixed on
a single RPC.
Raises:
An RpcError exception if the write failed.
"""
@ -223,6 +229,9 @@ class StreamStreamCall(
Read operations must be serialized when called from multiple
coroutines.
Note that the iterator and read/write APIs may not be mixed on
a single RPC.
Returns:
A response message, or an `grpc.aio.EOF` to indicate the end of the
stream.
@ -232,6 +241,9 @@ class StreamStreamCall(
async def write(self, request: RequestType) -> None:
"""Writes one message to the stream.
Note that the iterator and read/write APIs may not be mixed on
a single RPC.
Raises:
An RpcError exception if the write failed.
"""

Loading…
Cancel
Save