a
    v=icC  ã                   @   s¨   d Z ddlZddlZddlZejZeje_ejZG dd„ deƒZ	ddd„Z
ejZejZejZG dd	„ d	e ej¡ƒZG d
d„ de ej¡ƒZG dd„ de ej¡ƒZdS )z8Constants and interfaces of the Beta API of gRPC Python.é    Nc                   @   s   e Zd ZdZdd„ ZdS )ÚGRPCCallOptionszñA value encapsulating gRPC-specific options passed on RPC invocation.

  This class and its instances have no supported interface - it exists to
  define the type of its instances and its instances exist to be passed to
  other functions.
  c                 C   s   || _ || _|| _d S )N)Údisable_compressionÚ
subcall_ofÚcredentials)Úselfr   r   r   © r   úe/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/grpc/beta/interfaces.pyÚ__init__$   s    zGRPCCallOptions.__init__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r      s   r   Fc                 C   s   t | d|ƒS )a†  Creates a GRPCCallOptions value to be passed at RPC invocation.

  All parameters are optional and should always be passed by keyword.

  Args:
    disable_compression: A boolean indicating whether or not compression should
      be disabled for the request object of the RPC. Only valid for
      request-unary RPCs.
    credentials: A CallCredentials object to use for the invoked RPC.
  N)r   )r   r   r   r   r   Úgrpc_call_options*   s    r   c                   @   s,   e Zd ZdZejdd„ ƒZejdd„ ƒZdS )ÚGRPCServicerContextzCExposes gRPC-specific options and behaviors to code servicing RPCs.c                 C   s
   t ƒ ‚dS )z”Identifies the peer that invoked the RPC being serviced.

    Returns:
      A string identifying the peer that invoked the RPC being serviced.
    N©ÚNotImplementedError©r   r   r   r   Úpeer@   s    zGRPCServicerContext.peerc                 C   s
   t ƒ ‚dS )zDDisables compression of the next response passed by the application.Nr   r   r   r   r   Ú!disable_next_response_compressionI   s    z5GRPCServicerContext.disable_next_response_compressionN)r
   r   r   r   ÚabcÚabstractmethodr   r   r   r   r   r   r   =   s
   
r   c                   @   s   e Zd ZdZejdd„ ƒZdS )ÚGRPCInvocationContextzBExposes gRPC-specific options and behaviors to code invoking RPCs.c                 C   s
   t ƒ ‚dS )zCDisables compression of the next request passed by the application.Nr   r   r   r   r   Ú disable_next_request_compressionR   s    z6GRPCInvocationContext.disable_next_request_compressionN)r
   r   r   r   r   r   r   r   r   r   r   r   O   s   r   c                   @   sH   e Zd ZdZejdd„ ƒZejdd„ ƒZejdd„ ƒZejdd	„ ƒZ	d
S )ÚServerzServices RPCs.c                 C   s
   t ƒ ‚dS )a  Reserves a port for insecure RPC service once this Server becomes active.

    This method may only be called before calling this Server's start method is
    called.

    Args:
      address: The address for which to open a port.

    Returns:
      An integer port on which RPCs will be serviced after this link has been
        started. This is typically the same number as the port number contained
        in the passed address, but will likely be different if the port number
        contained in the passed address was zero.
    Nr   )r   Úaddressr   r   r   Úadd_insecure_port[   s    zServer.add_insecure_portc                 C   s
   t ƒ ‚dS )aF  Reserves a port for secure RPC service after this Server becomes active.

    This method may only be called before calling this Server's start method is
    called.

    Args:
      address: The address for which to open a port.
      server_credentials: A ServerCredentials.

    Returns:
      An integer port on which RPCs will be serviced after this link has been
        started. This is typically the same number as the port number contained
        in the passed address, but will likely be different if the port number
        contained in the passed address was zero.
    Nr   )r   r   Zserver_credentialsr   r   r   Úadd_secure_portm   s    zServer.add_secure_portc                 C   s
   t ƒ ‚dS )z”Starts this Server's service of RPCs.

    This method may only be called while the server is not serving RPCs (i.e. it
    is not idempotent).
    Nr   r   r   r   r   Ústart€   s    zServer.startc                 C   s
   t ƒ ‚dS )a¨  Stops this Server's service of RPCs.

    All calls to this method immediately stop service of new RPCs. When existing
    RPCs are aborted is controlled by the grace period parameter passed to this
    method.

    This method may be called at any time and is idempotent. Passing a smaller
    grace value than has been passed in a previous call will have the effect of
    stopping the Server sooner. Passing a larger grace value than has been
    passed in a previous call will not have the effect of stopping the server
    later.

    Args:
      grace: A duration of time in seconds to allow existing RPCs to complete
        before being aborted by this Server's stopping. May be zero for
        immediate abortion of all in-progress RPCs.

    Returns:
      A threading.Event that will be set when this Server has completely
      stopped. The returned event may not be set until after the full grace
      period (if some ongoing RPC continues for the full length of the period)
      of it may be set much sooner (such as if this Server had no RPCs underway
      at the time it was stopped or if all RPCs that it had underway completed
      very early in the grace period).
    Nr   )r   Zgracer   r   r   Ústop‰   s    zServer.stopN)
r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   X   s   


r   )FN)r   r   ZgrpcÚsixZChannelConnectivityÚSHUTDOWNZFATAL_FAILUREZ
StatusCodeÚobjectr   r   ZAuthMetadataContextZGRPCAuthMetadataContextZAuthMetadataPluginCallbackZGRPCAuthMetadataPluginCallbackZAuthMetadataPluginZGRPCAuthMetadataPluginÚwith_metaclassÚABCMetar   r   r   r   r   r   r   Ú<module>   s   
	