aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Ken Payson <kpayson@google.com>2017-02-14 12:58:24 -0800
committerGravatar Ken Payson <kpayson@google.com>2017-02-14 15:01:26 -0800
commitd5d9d9e6727df310596c005d1dfb38775182d05f (patch)
tree26d82a6632effa875c83906edf1dfadf0362b819 /src
parente60d5ff875dfd14d6f34f0ca1ead79c8a8038830 (diff)
Store cython-level call in grpc.Call
This allows inspecting c-level properties of the call after completion.
Diffstat (limited to 'src')
-rw-r--r--src/python/grpcio/grpc/_channel.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py
index 691e96a322..26d93faf75 100644
--- a/src/python/grpcio/grpc/_channel.py
+++ b/src/python/grpcio/grpc/_channel.py
@@ -444,10 +444,10 @@ def _start_unary_request(request, timeout, request_serializer):
return deadline, deadline_timespec, serialized_request, None
-def _end_unary_response_blocking(state, with_call, deadline):
+def _end_unary_response_blocking(state, call, with_call, deadline):
if state.code is grpc.StatusCode.OK:
if with_call:
- rendezvous = _Rendezvous(state, None, None, deadline)
+ rendezvous = _Rendezvous(state, call, None, deadline)
return state.response, rendezvous
else:
return state.response
@@ -499,17 +499,17 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
_check_call_error(call_error, metadata)
_handle_event(completion_queue.poll(), state,
self._response_deserializer)
- return state, deadline
+ return state, call, deadline
def __call__(self, request, timeout=None, metadata=None, credentials=None):
- state, deadline, = self._blocking(request, timeout, metadata,
- credentials)
- return _end_unary_response_blocking(state, False, deadline)
+ state, call, deadline = self._blocking(request, timeout, metadata,
+ credentials)
+ return _end_unary_response_blocking(state, call, False, deadline)
def with_call(self, request, timeout=None, metadata=None, credentials=None):
- state, deadline, = self._blocking(request, timeout, metadata,
- credentials)
- return _end_unary_response_blocking(state, True, deadline)
+ state, call, deadline = self._blocking(request, timeout, metadata,
+ credentials)
+ return _end_unary_response_blocking(state, call, True, deadline)
def future(self, request, timeout=None, metadata=None, credentials=None):
state, operations, deadline, deadline_timespec, rendezvous = self._prepare(
@@ -619,25 +619,25 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
state.condition.notify_all()
if not state.due:
break
- return state, deadline
+ return state, call, deadline
def __call__(self,
request_iterator,
timeout=None,
metadata=None,
credentials=None):
- state, deadline, = self._blocking(request_iterator, timeout, metadata,
- credentials)
- return _end_unary_response_blocking(state, False, deadline)
+ state, call, deadline = self._blocking(request_iterator, timeout,
+ metadata, credentials)
+ return _end_unary_response_blocking(state, call, False, deadline)
def with_call(self,
request_iterator,
timeout=None,
metadata=None,
credentials=None):
- state, deadline, = self._blocking(request_iterator, timeout, metadata,
- credentials)
- return _end_unary_response_blocking(state, True, deadline)
+ state, call, deadline = self._blocking(request_iterator, timeout,
+ metadata, credentials)
+ return _end_unary_response_blocking(state, call, True, deadline)
def future(self,
request_iterator,