Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lidizheng committed Jul 7, 2020
1 parent e58e24a commit b61fe7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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():
Expand Down

0 comments on commit b61fe7a

Please sign in to comment.