Skip to content

Commit

Permalink
Add low-level Cython debug/expansion hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdada committed Aug 2, 2018
1 parent 708288e commit c666aa6
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pxd.pxi
Original file line number Diff line number Diff line change
@@ -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(grpc_call *call)
17 changes: 17 additions & 0 deletions src/python/grpcio/grpc/_cython/_cygrpc/_hooks.pyx.pxi
Original file line number Diff line number Diff line change
@@ -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(grpc_call *call):
return None
2 changes: 2 additions & 0 deletions src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,5 @@ cdef class Call:
def is_valid(self):
return self.c_call != NULL

def _custom_op_on_c_call(self):
return _custom_op_on_c_call(self.c_call)
2 changes: 1 addition & 1 deletion src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions src/python/grpcio/grpc/_cython/cygrpc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions src/python/grpcio/grpc/_cython/cygrpc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit c666aa6

Please sign in to comment.