;izdZddlZddlZddlmZddlmZddlmZddlmZdZ Gdd ej Z d Z dS) z'Utilities for the gRPC Python Beta API.N)implementations) interfaces) callable_util)futurez6Exception calling connectivity future "done" callback!cbeZdZdZdZdZdZdZdZdZ dd Z dd Z dd Z d Z d ZdZdS)_ChannelReadyFuturecntj|_||_d|_d|_g|_dS)NF) threading Condition _condition_channel_matured _cancelled_done_callbacks)selfchannels GC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\grpc/beta/utilities.py__init__z_ChannelReadyFuture.__init__s5#-//  !c|dntj|z}|j5 |jrtj|jr ddddS||jnJ|tjz }|dkrtj|j|#1swxYwYdS)NTr)timeout)timer rrCancelledErrorrwait TimeoutError)rruntil remainings r_blockz_ChannelReadyFuture._block's-TY[[7-B _ @ @ @? @ /111] @ @ @ @ @ @ @ @ @ ]O((**** % 3I 1}}$1333,,Y,??? @ @ @ @ @ @ @ @ @ @ @s$B:A'B::B>B>c|j5|jsn|tjjur[d|_|j|j|j t|j }d|_ n ddddS dddn #1swxYwY|D]}tj |t|dS)NT)r rrChannelConnectivityREADYrr unsubscribe_update notify_alltuplerrcall_logging_exceptions$_DONE_CALLBACK_EXCEPTION_LOG_MESSAGE)r connectivitydone_callbacks done_callbacks rr#z_ChannelReadyFuture._update8s5 _  O  J$B$HHH $  ))$,777**,,,!&t';!rBrFrHrrrrs"""@@@"&$###===444GGG88888rrcLt|}||S)a&Creates a future.Future tracking when an implementations.Channel is ready. Cancelling the returned future.Future does not tell the given implementations.Channel to abandon attempts it may have been making to connect; cancelling merely deactivates the return future.Future's subscription to the given implementations.Channel's connectivity. Args: channel: An implementations.Channel. Returns: A future.Future that matures when the given Channel has connectivity interfaces.ChannelConnectivity.READY. )rrF)r ready_futures rchannel_ready_futurerOs)'w//L r) __doc__r r grpc.betarrgrpc.framework.foundationrrr'FuturerrOrLrrrTs.- &%%%%% 333333,,,,,,=% c8c8c8c8c8&-c8c8c8Lr