Merge pull request #14329 from mehrdada/fix-example-unary-stream

Fix Python example unary/stream conflict
pull/14330/head
Mehrdad Afshari 7 years ago committed by GitHub
commit 5d0e9c4aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/python/interceptors/headers/generic_client_interceptor.py

@ -33,14 +33,14 @@ class _GenericClientInterceptor(
request): request):
new_details, new_request_iterator, postprocess = self._fn( new_details, new_request_iterator, postprocess = self._fn(
client_call_details, iter((request,)), False, True) client_call_details, iter((request,)), False, True)
response_it = continuation(new_details, new_request_iterator) response_it = continuation(new_details, next(new_request_iterator))
return postprocess(response_it) if postprocess else response_it return postprocess(response_it) if postprocess else response_it
def intercept_stream_unary(self, continuation, client_call_details, def intercept_stream_unary(self, continuation, client_call_details,
request_iterator): request_iterator):
new_details, new_request_iterator, postprocess = self._fn( new_details, new_request_iterator, postprocess = self._fn(
client_call_details, request_iterator, True, False) client_call_details, request_iterator, True, False)
response = continuation(new_details, next(new_request_iterator)) response = continuation(new_details, new_request_iterator)
return postprocess(response) if postprocess else response return postprocess(response) if postprocess else response
def intercept_stream_stream(self, continuation, client_call_details, def intercept_stream_stream(self, continuation, client_call_details,

Loading…
Cancel
Save