From 1945c1108fc90727908a7022a58d1dd47c57cfb8 Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Tue, 11 Feb 2020 15:03:22 -0800 Subject: [PATCH] Move the docstring from Cython to rst --- doc/python/sphinx/grpc_asyncio.rst | 18 +++++++++++++++++- .../grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi | 8 -------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/doc/python/sphinx/grpc_asyncio.rst b/doc/python/sphinx/grpc_asyncio.rst index 280004d3a49..d70af2ef527 100644 --- a/doc/python/sphinx/grpc_asyncio.rst +++ b/doc/python/sphinx/grpc_asyncio.rst @@ -16,13 +16,29 @@ suggestions by opening issues on our GitHub repo `grpc/grpc `_. +Caveats +------- + +gRPC Async API objects may only be used on the thread on which they were +created. AsyncIO doesn't provide thread safety for most of its APIs. + + Module Contents --------------- Turn-On AsyncIO Mode ^^^^^^^^^^^^^^^^^^^^ -.. autofunction:: init_grpc_aio +.. function:: init_grpc_aio + + Turn-on AsyncIO mode for gRPC Python. + + This function is idempotent, and it should be invoked before creation of + AsyncIO stack objects. Otherwise, the application might deadlock. + + This function enables AsyncIO IO manager and disables threading for entire + process. After this point, there should not be blocking calls unless it is + taken cared by AsyncIO. Create Client diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi index d21b8a6da00..4b38779ab63 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi @@ -17,14 +17,6 @@ cdef bint _grpc_aio_initialized = 0 def init_grpc_aio(): - """Turn-on AsyncIO mode for gRPC Python. - - This function enables AsyncIO IO manager and disables threading for entire - process. After this point, there should not be blocking calls unless it is - taken cared by AsyncIO. - - This function is idempotent. - """ global _grpc_aio_initialized if _grpc_aio_initialized: