
    (ph1                         S r SSKrSSKJrJrJrJrJrJr  SSK	r	SSK
Jr  SSKJr  SSKJr  SSKJr  SS	KJr   " S
 S\R"                  5      r " S S\\\4   \R"                  5      rg)z.Abstract base classes for server-side classes.    N)GenericIterableMappingNoReturnOptionalSequence   )Metadata)DoneCallbackType)MetadataType)RequestType)ResponseTypec                   z   \ rS rSrSr\R                  S\\R                     SS4S j5       r
\R                  S\S\4S j5       r\R                  S\S	\R                  S\4S
 j5       r\R                  SS j5       r\R                  S\\   SS4S j5       r\R                   SS\\   S\4S jj5       rS rSrg)Server   zServes RPCs.generic_rpc_handlersreturnNc                     g)zRegisters GenericRpcHandlers with this Server.

This method is only safe to call before the server is started.

Args:
  generic_rpc_handlers: A sequence of GenericRpcHandlers that will be
  used to service RPCs.
N )selfr   s     H/var/www/html/venv/lib/python3.13/site-packages/grpc/aio/_base_server.pyadd_generic_rpc_handlersServer.add_generic_rpc_handlers           addressc                     g)a  Opens an insecure port for accepting RPCs.

A port is a communication endpoint that used by networking protocols,
like TCP and UDP. To date, we only support TCP.

This method may only be called before starting the server.

Args:
  address: The address for which to open a port. If the port is 0,
    or not specified in the address, then the gRPC runtime will choose a port.

Returns:
  An integer port on which the server will accept RPC requests.
Nr   )r   r   s     r   add_insecure_portServer.add_insecure_port,   r   r   server_credentialsc                     g)a  Opens a secure port for accepting RPCs.

A port is a communication endpoint that used by networking protocols,
like TCP and UDP. To date, we only support TCP.

This method may only be called before starting the server.

Args:
  address: The address for which to open a port.
    if the port is 0, or not specified in the address, then the gRPC
    runtime will choose a port.
  server_credentials: A ServerCredentials object.

Returns:
  An integer port on which the server will accept RPC requests.
Nr   )r   r   r    s      r   add_secure_portServer.add_secure_port=   r   r   c                    #    g7f)zWStarts this Server.

This method may only be called once. (i.e. it is not idempotent).
Nr   r   s    r   startServer.startR           gracec                    #    g7f)a  Stops this Server.

This method immediately stops the server from servicing new RPCs in
all cases.

If a grace period is specified, this method waits until all active
RPCs are finished or until the grace period is reached. RPCs that haven't
been terminated within the grace period are aborted.
If a grace period is not specified (by passing None for grace), all
existing RPCs are aborted immediately and this method blocks until
the last RPC handler terminates.

This method is idempotent and may be called at any time. Passing a
smaller grace value in a subsequent call will have the effect of
stopping the Server sooner (passing None will have the effect of
stopping the server immediately). Passing a larger grace value in a
subsequent call will not have the effect of stopping the server later
(i.e. the most restrictive grace value is used).

Args:
  grace: A duration of time in seconds or None.
Nr   )r   r*   s     r   stopServer.stopY   r(   r)   timeoutc                    #    g7f)aZ  Continues current coroutine once the server stops.

This is an EXPERIMENTAL API.

The wait will not consume computational resources during blocking, and
it will block until one of the two following conditions are met:

1) The server is stopped or terminated;
2) A timeout occurs if timeout is not `None`.

The timeout argument works in the same way as `threading.Event.wait()`.
https://docs.python.org/3/library/threading.html#threading.Event.wait

Args:
  timeout: A floating point number specifying a timeout for the
    operation in seconds.

Returns:
  A bool indicates if the operation times out.
Nr   )r   r.   s     r   wait_for_terminationServer.wait_for_terminationr   r(   r)   c                     g)zRegisters GenericRpcHandlers with this Server.

This method is only safe to call before the server is started.

Args:
  service_name: The service name.
  method_handlers: A dictionary that maps method names to corresponding
    RpcMethodHandler.
Nr   )r   service_namemethod_handlerss      r   add_registered_method_handlers%Server.add_registered_method_handlers   r   r   r   r   N)N)__name__
__module____qualname____firstlineno____doc__abcabstractmethodr   grpcGenericRpcHandlerr   strintr   ServerCredentialsr"   r&   r   floatr,   boolr0   r5   __static_attributes__r   r   r   r   r      s   
$,T-C-C$D
	
 
 	     	040F0F	 ( 	  	 D  0 	)-	 0	r   r   c            
       d   \ rS rSrSr\R                  S\4S j5       r\R                  S\	SS4S j5       r
\R                  S\SS4S	 j5       r\R                  S
\" 5       4S\R                  S\S\S\4S jj5       r\R                  S\SS4S j5       r\R                  S\\   4S j5       r\R                  S\R                  SS4S j5       r\R                  S\SS4S j5       r\R                  S\R0                  SS4S j5       r\R                  S#S j5       r\R                  S\4S j5       r\R                  S\\\      4S j5       r\R                  S\\   4S j5       r\R                  S\ \\\   4   4S j5       r!S\"4S jr#S r$S r%S r&S\'SS4S jr(S\)4S  jr*S\)4S! jr+S"r,g)$ServicerContext   z2A context object passed to method implementations.r   c                    #    g7f)zReads one message from the RPC.

Only one read operation is allowed simultaneously.

Returns:
  A response message of the RPC.

Raises:
  An RpcError exception if the read failed.
Nr   r%   s    r   readServicerContext.read   r(   r)   messageNc                    #    g7f)zWrites one message to the RPC.

Only one write operation is allowed simultaneously.

Raises:
  An RpcError exception if the write failed.
Nr   )r   rM   s     r   writeServicerContext.write   r(   r)   initial_metadatac                    #    g7f)zSends the initial metadata value to the client.

This method need not be called by implementations if they have no
metadata to add to what the gRPC runtime will transmit.

Args:
  initial_metadata: The initial :term:`metadata`.
Nr   )r   rQ   s     r   send_initial_metadata%ServicerContext.send_initial_metadata   r(   r)    codedetailstrailing_metadatac                    #    g7f)a  Raises an exception to terminate the RPC with a non-OK status.

The code and details passed as arguments will supersede any existing
ones.

Args:
  code: A StatusCode object to be sent to the client.
    It must not be StatusCode.OK.
  details: A UTF-8-encodable string to be sent to the client upon
    termination of the RPC.
  trailing_metadata: A sequence of tuple represents the trailing
    :term:`metadata`.

Raises:
  Exception: An exception is always raised to signal the abortion the
    RPC to the gRPC runtime.
Nr   )r   rV   rW   rX   s       r   abortServicerContext.abort   r(   r)   c                     g)zSends the trailing metadata for the RPC.

This method need not be called by implementations if they have no
metadata to add to what the gRPC runtime will transmit.

Args:
  trailing_metadata: The trailing :term:`metadata`.
Nr   )r   rX   s     r   set_trailing_metadata%ServicerContext.set_trailing_metadata   r   r   c                     g)zWAccesses the metadata sent by the client.

Returns:
  The invocation :term:`metadata`.
Nr   r%   s    r   invocation_metadata#ServicerContext.invocation_metadata   r   r   c                     g)zSets the value to be used as status code upon RPC completion.

This method need not be called by method implementations if they wish
the gRPC runtime to determine the status code of the RPC.

Args:
  code: A StatusCode object to be sent to the client.
Nr   )r   rV   s     r   set_codeServicerContext.set_code   r   r   c                     g)a  Sets the value to be used the as detail string upon RPC completion.

This method need not be called by method implementations if they have
no details to transmit.

Args:
  details: A UTF-8-encodable string to be sent to the client upon
    termination of the RPC.
Nr   )r   rW   s     r   set_detailsServicerContext.set_details   r   r   compressionc                     g)zSet the compression algorithm to be used for the entire call.

Args:
  compression: An element of grpc.compression, e.g.
    grpc.compression.Gzip.
Nr   )r   rh   s     r   set_compressionServicerContext.set_compression  r   r   c                     g)zDisables compression for the next response message.

This method will override any compression configuration set during
server creation or set on the call.
Nr   r%   s    r    disable_next_message_compression0ServicerContext.disable_next_message_compression  r   r   c                     g)zIdentifies the peer that invoked the RPC being serviced.

Returns:
  A string identifying the peer that invoked the RPC being serviced.
  The string format is determined by gRPC runtime.
Nr   r%   s    r   peerServicerContext.peer  r   r   c                     g)a  Gets one or more peer identity(s).

Equivalent to
servicer_context.auth_context().get(servicer_context.peer_identity_key())

Returns:
  An iterable of the identities, or None if the call is not
  authenticated. Each identity is returned as a raw bytes type.
Nr   r%   s    r   peer_identitiesServicerContext.peer_identities  r   r   c                     g)a  The auth property used to identify the peer.

For example, "x509_common_name" or "x509_subject_alternative_name" are
used to identify an SSL peer.

Returns:
  The auth property (string) that indicates the
  peer identity, or None if the call is not authenticated.
Nr   r%   s    r   peer_identity_key!ServicerContext.peer_identity_key(  r   r   c                     g)zqGets the auth context for the call.

Returns:
  A map of strings to an iterable of bytes for each auth property.
Nr   r%   s    r   auth_contextServicerContext.auth_context4  r   r   c                     g)a  Describes the length of allowed time remaining for the RPC.

Returns:
  A nonnegative float indicating the length of allowed time in seconds
  remaining for the RPC to complete before it is considered to have
  timed out, or None if no deadline was specified for the RPC.
Nr   r%   s    r   time_remainingServicerContext.time_remaining<  r   r   c                     [        5       e)zAccess value to be used as trailing metadata upon RPC completion.

This is an EXPERIMENTAL API.

Returns:
  The trailing :term:`metadata` for the RPC.
NotImplementedErrorr%   s    r   rX   !ServicerContext.trailing_metadataE       "##r   c                     [        5       e)zAccesses the value to be used as status code upon RPC completion.

This is an EXPERIMENTAL API.

Returns:
  The StatusCode value for the RPC.
r   r%   s    r   rV   ServicerContext.codeO  r   r   c                     [        5       e)zAccesses the value to be used as detail string upon RPC completion.

This is an EXPERIMENTAL API.

Returns:
  The details string of the RPC.
r   r%   s    r   rW   ServicerContext.detailsY  r   r   callbackc                     g)zRegisters a callback to be called on RPC termination.

This is an EXPERIMENTAL API.

Args:
  callback: A callable object will be called with the servicer context
    object as its only argument.
Nr   )r   r   s     r   add_done_callback!ServicerContext.add_done_callbackc  r   r   c                     g)zReturn True if the RPC is cancelled.

The RPC is cancelled when the cancellation was requested with cancel().

This is an EXPERIMENTAL API.

Returns:
  A bool indicates whether the RPC is cancelled or not.
Nr   r%   s    r   	cancelledServicerContext.cancelledm  r   r   c                     g)zReturn True if the RPC is done.

An RPC is done if the RPC is completed, cancelled or aborted.

This is an EXPERIMENTAL API.

Returns:
  A bool indicates if the RPC is done.
Nr   r%   s    r   doneServicerContext.donex  r   r   r   r7   )-r8   r9   r:   r;   r<   r=   r>   r   rK   r   rO   r   rS   tupler?   
StatusCoderA   r   rZ   r]   r   r`   rc   rf   Compressionrj   rm   rp   r   bytesrs   rv   r   ry   rD   r|   rX   rV   rW   r   r   rE   r   r   rF   r   r   r   rH   rH      s   <
K 
 
 	< D   	
 ,
	
 
 	 */'	oo  (	
 
 0 	|    	Xl%;   	T__    		3 	4 	 	 	4+;+;    	  	c   		(5/!: 	 	 		8C= 	 	 	gc8E?&:;   $$$*: t 	4 		d 	r   rH   )r<   r=   typingr   r   r   r   r   r   r?   	_metadatar
   _typingr   r   r   r   ABCr   rH   r   r   r   <module>r      sV    5 
 K K   % !   !xSWW xxigk<78#'' ir   