Address comments

pull/23377/head
Lidi Zheng 5 years ago
parent e58e24afb9
commit b61fe7ab33
  1. 2
      src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi
  2. 6
      src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
  3. 6
      src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi

@ -50,7 +50,7 @@ cdef class BaseCompletionQueue:
cdef grpc_completion_queue* c_ptr(self)
cdef class _EventLoopBound:
cdef class _BoundEventLoop:
cdef readonly object loop
cdef readonly object read_socket

@ -38,7 +38,7 @@ cdef class BaseCompletionQueue:
return self._cq
cdef class _EventLoopBound:
cdef class _BoundEventLoop:
def __cinit__(self, object loop, object read_socket, object handler):
self.loop = loop
@ -73,11 +73,11 @@ cdef class PollerCompletionQueue(BaseCompletionQueue):
self._queue = cpp_event_queue()
def bound_loop(self, object loop):
def bind_loop(self, object loop):
if loop in self._loops:
return
else:
self._loops[loop] = _EventLoopBound(loop, self._read_socket, self._handle_events)
self._loops[loop] = _BoundEventLoop(loop, self._read_socket, self._handle_events)
cdef void _poll(self) nogil:
cdef grpc_event event

@ -111,10 +111,10 @@ cdef _actual_aio_shutdown():
raise ValueError('Unsupported engine type [%s]' % _global_aio_state.engine)
cdef _per_loop_initialization():
cdef _initialize_per_loop():
cdef object loop = get_working_loop()
if _global_aio_state.engine is AsyncIOEngine.POLLER:
_global_aio_state.cq.bound_loop(loop)
_global_aio_state.cq.bind_loop(loop)
cpdef init_grpc_aio():
@ -127,7 +127,7 @@ cpdef init_grpc_aio():
_global_aio_state.refcount += 1
if _global_aio_state.refcount == 1:
_actual_aio_initialization()
_per_loop_initialization()
_initialize_per_loop()
cpdef shutdown_grpc_aio():

Loading…
Cancel
Save