diff options
author | 2017-05-01 14:17:06 -0700 | |
---|---|---|
committer | 2017-05-01 14:17:06 -0700 | |
commit | 7e7ac1c60c9e26868f0fa75f8c81a4d470795363 (patch) | |
tree | f8585268894314d9b9ea44fca32665007a37edf1 /src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi | |
parent | 6626a86923aaebae86aeeba151c99ed3089d02fc (diff) |
Fix Python interop tests
Diffstat (limited to 'src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi')
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi index 34b2623d34..502b6556b4 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi @@ -37,9 +37,16 @@ cdef int _INTERRUPT_CHECK_PERIOD_MS = 200 cdef class CompletionQueue: - def __cinit__(self): + def __cinit__(self, shutdown_cq=False): + cdef grpc_completion_queue_attributes c_attrs grpc_init() - with nogil: + if shutdown_cq: + c_attrs.version = 1 + c_attrs.cq_completion_type = GRPC_CQ_NEXT + c_attrs.cq_polling_type = GRPC_CQ_NON_LISTENING + self.c_completion_queue = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&c_attrs), &c_attrs, NULL); + else: self.c_completion_queue = grpc_completion_queue_create_for_next(NULL) self.is_shutting_down = False self.is_shutdown = False |