
    1i                         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	e      Ze	eeef      Z G d
 dee      Zy)    )abstractmethod)OptionalUnion)RedisRedisCluster)WeightedList)CircuitBreaker)AbstractDatabaseBaseDatabase)Numberc                       e Zd ZdZeedeeef   fd              Z	e	j                  edeeef   fd              Z	eedefd              Zej                  edefd              Zy	)
AsyncDatabasez6Database with an underlying asynchronous redis client.returnc                      y)zThe underlying redis client.N selfs    h/mnt/e/genesis-system/.venvs/voice-bridge/lib/python3.12/site-packages/redis/asyncio/multidb/database.pyclientzAsyncDatabase.client        	    r   c                      y)z Set the underlying redis client.Nr   r   r   s     r   r   zAsyncDatabase.client   r   r   c                      y)z)Circuit breaker for the current database.Nr   r   s    r   circuitzAsyncDatabase.circuit   r   r   r   c                      y)z1Set the circuit breaker for the current database.Nr   r   r   s     r   r   zAsyncDatabase.circuit    r   r   N)__name__
__module____qualname____doc__propertyr   r   r   r   r   setterr	   r   r   r   r   r   r      s    @e\12    ]]U5,#67        ^^~   r   r   c            
            e Zd Z	 ddeeef   dededee	   f fdZ
edeeef   fd       Zej                  deeef   fd       Zedefd	       Zej                  defd
       Zd Z xZS )Databaser   r   weighthealth_check_urlc                 d    || _         || _        | | j                  _        t        |   ||       y N)_client_cbdatabasesuper__init__)r   r   r   r&   r'   	__class__s        r   r.   zDatabase.__init__+   s/      !12r   r   c                     | j                   S r)   r*   r   s    r   r   zDatabase.client7   s    ||r   c                     || _         y r)   r1   r   s     r   r   zDatabase.client;   s	    r   c                     | j                   S r)   r+   r   s    r   r   zDatabase.circuit?   s    xxr   c                     || _         y r)   r4   r   s     r   r   zDatabase.circuitC   s	    r   c                 <    d| j                    d| j                   dS )NzDatabase(client=z	, weight=))r   r&   r   s    r   __repr__zDatabase.__repr__G   s    !$++i}AFFr   r)   )r   r   r    r   r   r   r	   floatr   strr.   r"   r   r#   r   r8   __classcell__)r/   s   @r   r%   r%   *   s     +/
3e\)*
3  
3 	
3
 #3-
3 e\12   ]]U5,#67      ^^~  Gr   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   <module>rE      sM     " - - 0 A $ 8 }f456	G|] Gr   