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   ú]/root/parts/websockify/install/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    