Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update client.py #144

Merged
merged 2 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions grpclib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ async def recv_message(self) -> Optional[_RecvType]:

If server sends UNARY response, then you can call this coroutine only
once. If server sends STREAM response, then you should call this
coroutine several times, until it returns None. To simplify you code in
this case, :py:class:`Stream` implements async iterations protocol, so
you can use it like this:
coroutine several times, until it returns None when the server has
ended the stream. To simplify you code in this case, :py:class:`Stream`
implements async iterations protocol, so you can use it like this:

.. code-block:: python3

Expand Down Expand Up @@ -816,6 +816,7 @@ class ServiceMethod(Generic[_SendType, _RecvType]):
"""
Base class for all gRPC method types
"""

def __init__(
self,
channel: Channel,
Expand Down
7 changes: 4 additions & 3 deletions grpclib/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ async def recv_message(self) -> Optional[_RecvType]:

If client sends UNARY request, then you can call this coroutine
only once. If client sends STREAM request, then you should call this
coroutine several times, until it returns None. To simplify your code
in this case, :py:class:`Stream` class implements async iteration
protocol, so you can use it like this:
coroutine several times, until it returns None when the client has
ended the stream. To simplify your code in this case,
:py:class:`Stream` class implements async iteration protocol, so
you can use it like this:

.. code-block:: python3

Expand Down