diff options
author | Mehrdad Afshari <mehrdada@users.noreply.github.com> | 2018-08-02 13:26:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 13:26:14 -0700 |
commit | 16a836174307f8694a7f1cb9309091095add74e2 (patch) | |
tree | cabeb663d97c1e055080f1a2ad375e38a9161780 /src | |
parent | 21fe5a71c6fc08cae89dafa0f75210b04ab5b9da (diff) | |
parent | f61e16144ec557c3c50733e1ace4cdb4625efe05 (diff) |
Merge pull request #16223 from mehrdada/debug_hooks
Add low-level Cython debug/expansion hooks
Diffstat (limited to 'src')
6 files changed, 38 insertions, 1 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pxd.pxi new file mode 100644 index 0000000000..3eb10f5275 --- /dev/null +++ b/src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pxd.pxi @@ -0,0 +1,16 @@ +# Copyright 2018 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +cdef object _custom_op_on_c_call(int op, grpc_call *call) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pyx.pxi new file mode 100644 index 0000000000..38cf629dc2 --- /dev/null +++ b/src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pyx.pxi @@ -0,0 +1,17 @@ +# Copyright 2018 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +cdef object _custom_op_on_c_call(int op, grpc_call *call): + raise NotImplementedError("No custom hooks are implemented") diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi index 2e02111ddd..a0de862d94 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi @@ -94,3 +94,5 @@ cdef class Call: def is_valid(self): return self.c_call != NULL + def _custom_op_on_c_call(self, int op): + return _custom_op_on_c_call(op, self.c_call) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi index 8c37a3cf85..893df8eac6 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi @@ -300,7 +300,7 @@ cdef class SegregatedCall: def next_event(self): def on_success(tag): _process_segregated_call_tag( - self._channel_state, self._call_state, self._c_completion_queue, tag) + self._channel_state, self._call_state, self._c_completion_queue, tag) return _next_call_event( self._channel_state, self._c_completion_queue, on_success) diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pxd b/src/python/grpcio/grpc/_cython/cygrpc.pxd index e33c01c28f..0cc26bc0d0 100644 --- a/src/python/grpcio/grpc/_cython/cygrpc.pxd +++ b/src/python/grpcio/grpc/_cython/cygrpc.pxd @@ -28,5 +28,6 @@ include "_cygrpc/security.pxd.pxi" include "_cygrpc/server.pxd.pxi" include "_cygrpc/tag.pxd.pxi" include "_cygrpc/time.pxd.pxi" +include "_cygrpc/_hooks.pxd.pxi" include "_cygrpc/grpc_gevent.pxd.pxi" diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pyx b/src/python/grpcio/grpc/_cython/cygrpc.pyx index fb16fb16bf..3cac406687 100644 --- a/src/python/grpcio/grpc/_cython/cygrpc.pyx +++ b/src/python/grpcio/grpc/_cython/cygrpc.pyx @@ -35,6 +35,7 @@ include "_cygrpc/security.pyx.pxi" include "_cygrpc/server.pyx.pxi" include "_cygrpc/tag.pyx.pxi" include "_cygrpc/time.pyx.pxi" +include "_cygrpc/_hooks.pyx.pxi" include "_cygrpc/grpc_gevent.pyx.pxi" |