19 from grpc_testing
import _common
22 _LOGGER = logging.getLogger(__name__)
27 def __init__(self, handler, invocation_metadata):
49 for callback
in callbacks:
53 _LOGGER.exception(
'Exception calling server-side callback!')
55 callback_calling_thread = threading.Thread(target=call_back)
56 callback_calling_thread.start()
61 self.
_handler.send_termination(trailing_metadata, code, details)
67 trailing_metadata = _common.FUSSED_EMPTY_METADATA
71 code = grpc.StatusCode.OK
75 self.
_terminate(trailing_metadata, code, details)
78 self.
_terminate(_common.FUSSED_EMPTY_METADATA, code, details)
86 self.
_abort(grpc.StatusCode.CANCELLED,
87 'Cancelled by server-side application!')
92 _LOGGER.exception(
'Exception calling application!')
94 grpc.StatusCode.UNKNOWN,
95 'Exception calling application: {}'.
format(exception))
107 self.
_handler.add_response(response)
113 self.
_handler.add_response(response)