|
|
@ -15,6 +15,7 @@ |
|
|
|
import socket |
|
|
|
import socket |
|
|
|
|
|
|
|
|
|
|
|
cdef gpr_timespec _GPR_INF_FUTURE = gpr_inf_future(GPR_CLOCK_REALTIME) |
|
|
|
cdef gpr_timespec _GPR_INF_FUTURE = gpr_inf_future(GPR_CLOCK_REALTIME) |
|
|
|
|
|
|
|
cdef float _POLL_AWAKE_INTERVAL_S = 0.2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF UNAME_SYSNAME == "Windows": |
|
|
|
IF UNAME_SYSNAME == "Windows": |
|
|
@ -80,6 +81,8 @@ cdef class PollerCompletionQueue(BaseCompletionQueue): |
|
|
|
self._loop.remove_reader(self._read_socket) |
|
|
|
self._loop.remove_reader(self._read_socket) |
|
|
|
# TODO(https://github.com/grpc/grpc/issues/22365) perform graceful shutdown |
|
|
|
# TODO(https://github.com/grpc/grpc/issues/22365) perform graceful shutdown |
|
|
|
grpc_completion_queue_shutdown(self._cq) |
|
|
|
grpc_completion_queue_shutdown(self._cq) |
|
|
|
|
|
|
|
while not self._shutdown: |
|
|
|
|
|
|
|
self._poller_thread.join(timeout=_POLL_AWAKE_INTERVAL_S) |
|
|
|
grpc_completion_queue_destroy(self._cq) |
|
|
|
grpc_completion_queue_destroy(self._cq) |
|
|
|
|
|
|
|
|
|
|
|
def _handle_events(self): |
|
|
|
def _handle_events(self): |
|
|
|