14 """Utilities for the gRPC Python Beta API."""
25 _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE = (
26 'Exception calling connectivity future "done" callback!')
40 until =
None if timeout
is None else time.time() + timeout
44 raise future.CancelledError()
51 remaining = until - time.time()
53 raise future.TimeoutError()
60 connectivity
is interfaces.ChannelConnectivity.READY):
69 for done_callback
in done_callbacks:
70 callable_util.call_logging_exceptions(
71 done_callback, _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE, self)
84 for done_callback
in done_callbacks:
85 callable_util.call_logging_exceptions(
86 done_callback, _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE, self)
133 """Creates a future.Future tracking when an implementations.Channel is ready.
135 Cancelling the returned future.Future does not tell the given
136 implementations.Channel to abandon attempts it may have been making to
137 connect; cancelling merely deactivates the return future.Future's
138 subscription to the given implementations.Channel's connectivity.
141 channel: An implementations.Channel.
144 A future.Future that matures when the given Channel has connectivity
145 interfaces.ChannelConnectivity.READY.