[Documentation] fix asyncio Server and Channel stop() method documentation (#35946)

The stop/cancel methods actually wait if a grace period is specified, and do not "return immediately":

* 5227db884d/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi (L1060-L1063)
* 5227db884d/src/python/grpcio/grpc/aio/_channel.py (L444)
* 5227db884d/src/python/grpcio/grpc/_server.py (L1253)

Closes #35946

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35946 from Tasssadar:fix_grpc_stop_docs 1bafaa1eeb
PiperOrigin-RevId: 621230612
pull/36227/head
Vojtěch Boček 1 year ago committed by Copybara-Service
parent 4bea12353c
commit d9badb171a
  1. 5
      src/python/grpcio/grpc/__init__.py
  2. 9
      src/python/grpcio/grpc/aio/_base_channel.py
  3. 11
      src/python/grpcio/grpc/aio/_base_server.py
  4. 11
      src/python/grpcio/grpc/aio/_server.py

@ -1500,8 +1500,9 @@ class Server(abc.ABC):
This method immediately stop service of new RPCs in all cases.
If a grace period is specified, this method returns immediately
and all RPCs active at the end of the grace period are aborted.
If a grace period is specified, this method waits until all active
RPCs are finished or until the grace period is reached. RPCs that haven't
been terminated within the grace period are aborted.
If a grace period is not specified (by passing None for `grace`),
all existing RPCs are aborted immediately and this method
blocks until the last RPC handler terminates.

@ -209,10 +209,11 @@ class Channel(abc.ABC):
This method immediately stops the channel from executing new RPCs in
all cases.
If a grace period is specified, this method wait until all active
RPCs are finshed, once the grace period is reached the ones that haven't
been terminated are cancelled. If a grace period is not specified
(by passing None for grace), all existing RPCs are cancelled immediately.
If a grace period is specified, this method waits until all active
RPCs are finished or until the grace period is reached. RPCs that haven't
been terminated within the grace period are aborted.
If a grace period is not specified (by passing None for grace),
all existing RPCs are cancelled immediately.
This method is idempotent.
"""

@ -93,11 +93,12 @@ class Server(abc.ABC):
This method immediately stops the server from servicing new RPCs in
all cases.
If a grace period is specified, this method returns immediately and all
RPCs active at the end of the grace period are aborted. If a grace
period is not specified (by passing None for grace), all existing RPCs
are aborted immediately and this method blocks until the last RPC
handler terminates.
If a grace period is specified, this method waits until all active
RPCs are finished or until the grace period is reached. RPCs that haven't
been terminated within the grace period are aborted.
If a grace period is not specified (by passing None for grace), all
existing RPCs are aborted immediately and this method blocks until
the last RPC handler terminates.
This method is idempotent and may be called at any time. Passing a
smaller grace value in a subsequent call will have the effect of

@ -131,11 +131,12 @@ class Server(_base_server.Server):
This method immediately stops the server from servicing new RPCs in
all cases.
If a grace period is specified, this method returns immediately and all
RPCs active at the end of the grace period are aborted. If a grace
period is not specified (by passing None for grace), all existing RPCs
are aborted immediately and this method blocks until the last RPC
handler terminates.
If a grace period is specified, this method waits until all active
RPCs are finished or until the grace period is reached. RPCs that haven't
been terminated within the grace period are aborted.
If a grace period is not specified (by passing None for grace), all
existing RPCs are aborted immediately and this method blocks until
the last RPC handler terminates.
This method is idempotent and may be called at any time. Passing a
smaller grace value in a subsequent call will have the effect of

Loading…
Cancel
Save