14 """Base class for interceptors that operate on all RPC types."""
25 self.
_fn = interceptor_function
28 new_details, new_request_iterator, postprocess = self.
_fn(
29 client_call_details,
iter((request,)),
False,
False)
30 response = continuation(new_details,
next(new_request_iterator))
31 return postprocess(response)
if postprocess
else response
35 new_details, new_request_iterator, postprocess = self.
_fn(
36 client_call_details,
iter((request,)),
False,
True)
37 response_it = continuation(new_details,
next(new_request_iterator))
38 return postprocess(response_it)
if postprocess
else response_it
42 new_details, new_request_iterator, postprocess = self.
_fn(
43 client_call_details, request_iterator,
True,
False)
44 response = continuation(new_details, new_request_iterator)
45 return postprocess(response)
if postprocess
else response
49 new_details, new_request_iterator, postprocess = self.
_fn(
50 client_call_details, request_iterator,
True,
True)
51 response_it = continuation(new_details, new_request_iterator)
52 return postprocess(response_it)
if postprocess
else response_it