o
    i                     @   s   d dl mZ d dlmZmZ d dlmZmZ d dlm	Z	 d dl
mZ d dlmZmZ d dlmZ G dd	 d	eZe	eeef  ZG d
d deeZdS )    )abstractmethod)OptionalUnion)RedisRedisCluster)WeightedList)CircuitBreaker)AbstractDatabaseBaseDatabase)Numberc                   @   s|   e Zd ZdZeedeeef fddZ	e	j
edeeef fddZ	eedefddZej
ed	efd
dZdS )AsyncDatabasez6Database with an underlying asynchronous redis client.returnc                 C      dS )zThe underlying redis client.N selfr   r   R/home/ubuntu/.local/lib/python3.10/site-packages/redis/asyncio/multidb/database.pyclient      zAsyncDatabase.clientr   c                 C   r   )z Set the underlying redis client.Nr   r   r   r   r   r   r      r   c                 C   r   )z)Circuit breaker for the current database.Nr   r   r   r   r   circuit   r   zAsyncDatabase.circuitr   c                 C   r   )z1Set the circuit breaker for the current database.Nr   r   r   r   r   r   r       r   N)__name__
__module____qualname____doc__propertyr   r   r   r   r   setterr   r   r   r   r   r   r      s    r   c                
       s   e Zd Z	ddeeef dededee	 f fddZ
edeeef fd	d
Zejdeeef fdd
ZedefddZejdefddZdd Z  ZS )DatabaseNr   r   weighthealth_check_urlc                    s&   || _ || _| | j_t || d S N)_client_cbdatabasesuper__init__)r   r   r   r   r    	__class__r   r   r&   +   s   zDatabase.__init__r   c                 C      | j S r!   r"   r   r   r   r   r   7      zDatabase.clientc                 C   
   || _ d S r!   r*   r   r   r   r   r   ;      
c                 C   r)   r!   r#   r   r   r   r   r   ?   r+   zDatabase.circuitc                 C   r,   r!   r.   r   r   r   r   r   C   r-   c                 C   s   d| j  d| j dS )NzDatabase(client=z	, weight=))r   r   r   r   r   r   __repr__G   s   zDatabase.__repr__r!   )r   r   r   r   r   r   r   floatr   strr&   r   r   r   r   r0   __classcell__r   r   r'   r   r   *   s(    
r   N)abcr   typingr   r   redis.asyncior   r   redis.data_structurer   redis.multidb.circuitr   redis.multidb.databaser	   r
   redis.typingr   r   tuple	Databasesr   r   r   r   r   <module>   s    