Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_server.cpython-313.pyc144 linesDownload Raw Back to __pycache__
1�

2��jD$��\�SrSSKJr SSKJrJrJrJr SSKrSSKJ	r	 SSKJ3r4 SSKJr SS	K
Jr SS5KJr SSKJr S\S
\\R&4Sjr"SS\R*5rSS\\S\\\R,S\\\S\\S\\S
\\R&4Sjjrg)z2Server-side implementation of gRPC Asyncio Python.�)�Executor)�Any�Dict�Optional�SequenceN)�_common)�_compression)�cygrpc�)�_base_server)�ServerInterceptor)�ChannelArgumentType�base_options�compressionc�J�[R"U5n[U5U-$�N)r	�create_channel_option�tuple)rr�compression_options   �VD:\code\apps\devtools\python\user_packages\Python313\site-packages\grpc/aio/_server.py�_augment_channel_argumentsrs&��&�;�;�K�H�����!3�3�3�c
�n�\rSrSrSrS\\S\\\RS\\\6S\S\\S\\R4S	jrS7\\RSS4S
jrS\S\\\R$4SS4SjrS\S\4SjrS\S\R*S\4SjrSSjrS\\SS4SjrSS\\S\4SjjrSrSrg)�Server�$zServes RPCs.�thread_pool�generic_handlers�interceptors�options�maximum_concurrent_rpcsrc8�0�[R"5UlU(a=UVs/sHn[U[5(aMUPM nnU(a
Sn	[U	5e[R"URUUU[XF5U5Ulgs snf)NzWInterceptor must be ServerInterceptor,the following are invalid: {invalid_interceptors})	r9�get_working_loop�_loop�10isinstancer
�11ValueError�	AioServerr�_server)12�selfrrrrr r�interceptor�invalid_interceptors�	error_msgs13          r�__init__�Server.__init__'s����,�,�.��14��$0�$�#/�K�!�+�/@�A��#/�
!�$�15$�H��!��+�+��'�'��J�J����&�w�<�#�
16����$s�B�B�generic_rpc_handlers�returnNc�:�URRU5 g)z�Registers GenericRpcHandlers with this Server.17 18This method is only safe to call before the server is started.19 20Args:21  generic_rpc_handlers: A sequence of GenericRpcHandlers that will be22  used to service RPCs.23N)r'�add_generic_rpc_handlers)r(r.s  rr1�Server.add_generic_rpc_handlersHs��	
���-�-�.B�Cr�service_name�method_handlersc��gr�)r(r3r4s   r�add_registered_method_handlers�%Server.add_registered_method_handlersUs��	
r�addressc��[R"XRR[R"U555$)aJOpens an insecure port for accepting RPCs.24 25This method may only be called before starting the server.26 27Args:28  address: The address for which to open a port. If the port is 0,29    or not specified in the address, then the gRPC runtime will choose a port.30 31Returns:32  An integer port on which the server will accept RPC requests.33)r�validate_port_binding_resultr'�add_insecure_port�encode)r(r9s  rr<�Server.add_insecure_port]s2���3�3��\�\�3�3�G�N�N�7�4K�L�34�	35r�server_credentialsc��[R"UURR[R"U5U55$)a}Opens a secure port for accepting RPCs.36 37This method may only be called before starting the server.38 39Args:40  address: The address for which to open a port.41    if the port is 0, or not specified in the address, then the gRPC42    runtime will choose a port.43  server_credentials: A ServerCredentials object.44 45Returns:46  An integer port on which the server will accept RPC requests.47)rr;r'�add_secure_portr=)r(r9r?s   rrA�Server.add_secure_portms;�� �3�3���L�L�(�(����w�'�);�
�48�	49rc��T# �URR5IShv�N gN7f)zWStarts this Server.50 51This method may only be called once. (i.e. it is not idempotent).52N)r'�start�r(s rrD�Server.start�s���53�l�l� � �"�"�"�s�(�&�(�gracec��V# �URRU5IShv�N gN7f)a�Stops this Server.54 55This method immediately stops the server from servicing new RPCs in56all cases.57 58If a grace period is specified, this method waits until all active59RPCs are finished or until the grace period is reached. RPCs that haven't60been terminated within the grace period are aborted.61If a grace period is not specified (by passing None for grace), all62existing RPCs are aborted immediately and this method blocks until63the last RPC handler terminates.64 65This method is idempotent and may be called at any time. Passing a66smaller grace value in a subsequent call will have the effect of67stopping the Server sooner (passing None will have the effect of68stopping the server immediately). Passing a larger grace value in a69subsequent call will not have the effect of stopping the server later70(i.e. the most restrictive grace value is used).71 72Args:73  grace: A duration of time in seconds or None.74N)r'�shutdown)r(rGs  r�stop�Server.stop�s���.�l�l�#�#�E�*�*�*�s�)�'�)�timeoutc��T# �URRU5IShv�N$N7f)aWBlock current coroutine until the server stops.75 76This is an EXPERIMENTAL API.77 78The wait will not consume computational resources during blocking, and79it will block until one of the two following conditions are met:80 811) The server is stopped or terminated;822) A timeout occurs if timeout is not `None`.83 84The timeout argument works in the same way as `threading.Event.wait()`.85https://docs.python.org/3/library/threading.html#threading.Event.wait86 87Args:88  timeout: A floating point number specifying a timeout for the89    operation in seconds.90 91Returns:92  A bool indicates if the operation times out.93N)r'�wait_for_termination)r(rLs  rrN�Server.wait_for_termination�s"���.�\�\�6�6�w�?�?�?�?�s�(�&�(c���[US5(a[URR5(a;[R"URRS5UR5 ggg)z�Schedules a graceful shutdown in current event loop.94 95The Cython AioServer doesn't hold a ref-count to this class. It should96be safe to slightly extend the underlying Cython object's life span.97r'N)�hasattrr'�98is_runningr99�schedule_coro_threadsaferIr#rEs r�__del__�Server.__del__�sS���4��#�#����(?�(?�(A�(A��+�+����%�%�d�+��100�101�
�)B�#r)r#r')r/Nr)�__name__�102__module__�__qualname__�__firstlineno__�__doc__rrr�grpc�GenericRpcHandlerrr�int�Compressionr,r1�strr�RpcMethodHandlerr7r<�ServerCredentialsrArD�floatrJ�boolrNrT�__static_attributes__r6rrrr$s>���103��h�'�104�#�8�D�,B�,B�#C�D�105��x��}�-�	106�107%�108�"*�#��
109��d�.�.�/�110�BD�$,�T�-C�-C�$D�D�	
�D�
��
��c�4�#8�#8�8�9�
�111�	
�112��113��114� 115��116�04�0F�0F�117�	�118�.#�+����+�D�+�4*.�@����@�	
�@�2119rr�migration_thread_pool�handlersrrr c�L�[UUcSOUUcSOUUcSUU5$UUU5$)a�Creates a Server with which RPCs can be serviced.120 121Args:122  migration_thread_pool: A futures.ThreadPoolExecutor to be used by the123    Server to execute non-AsyncIO RPC handlers for migration purpose.124  handlers: An optional list of GenericRpcHandlers used for executing RPCs.125    More handlers may be added by calling add_generic_rpc_handlers any time126    before the server is started.127  interceptors: An optional list of ServerInterceptor objects that observe128    and optionally manipulate the incoming RPCs before handing them over to129    handlers. The interceptors are given control in the order they are130    specified. This is an EXPERIMENTAL API.131  options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC runtime)132    to configure the channel.133  maximum_concurrent_rpcs: The maximum number of concurrent RPCs this server134    will service before returning RESOURCE_EXHAUSTED status, or None to135    indicate no limit.136  compression: An element of grpc.Compression, e.g.137    grpc.Compression.Gzip. This compression algorithm will be used for the138    lifetime of the server unless overridden by set_compression.139 140Returns:141  A Server object.142r6)r)rerfrrr rs      r�serverrh�sK��@�����H��"����o����
��$+���
�r)NNNNNN)rZ�concurrent.futuresr�typingrrrrr[rr	�grpc._cythonr143�r�_interceptorr
�_typingrr^rrr\r]rhr6rr�<module>ros���9�'�0�0������+�(�4�%�4�4<�T�=M�=M�4N�4�c�\�
 �
 �c�N15�;?�,0�-1�-1�.2�
'�#�H�-�'��x�� 6� 6�7�8�'��8�C�=�)�'��)�
*�	'�144&�c�]�'��$�*�*�+�
'r
codekingpro/portable-devtools · Team Ai