14 """Internal utilities for gRPC Python."""
22 from grpc
import _common
25 _LOGGER = logging.getLogger(__name__)
27 _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE = (
28 'Exception calling connectivity future "done" callback!')
32 collections.namedtuple(
'_RpcMethodHandler', (
35 'request_deserializer',
36 'response_serializer',
50 _common.fully_qualified_method(service, method): method_handler
51 for method, method_handler
in six.iteritems(method_handlers)
72 until =
None if timeout
is None else time.time() + timeout
83 remaining = until - time.time()
92 connectivity
is grpc.ChannelConnectivity.READY):
101 for done_callback
in done_callbacks:
105 _LOGGER.exception(_DONE_CALLBACK_EXCEPTION_LOG_MESSAGE)
118 for done_callback
in done_callbacks:
122 _LOGGER.exception(_DONE_CALLBACK_EXCEPTION_LOG_MESSAGE)