
    gi<                        d Z ddlmZ ddlZddlmZ ddlmZmZ ddl	m
Z ddlmZ dd	lmZ erdd
lmZ  ej        d          Z G d d          Z G d de          ZdS )z.
Psycopg AsyncPipeline object implementation.
    )annotationsN)TracebackType)TYPE_CHECKINGAny   )errors)Self)BasePipeline)AsyncConnectionpsycopgc                      e Zd ZddZdd
ZdS )
_DummyLockreturnNonec                
   K   d S N selfs    g/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/psycopg/_pipeline_async.py
__aenter__z_DummyLock.__aenter__   s          exc_typetype[BaseException] | Noneexc_valBaseException | Noneexc_tbTracebackType | Nonec                
   K   d S r   r   )r   r   r   r   s       r   	__aexit__z_DummyLock.__aexit__   s       	r   Nr   r   r   r   r   r   r   r   r   r   )__name__
__module____qualname__r   r    r   r   r   r   r      s<                r   r   c                  N     e Zd ZU dZdZded<   dd fdZddZddZddZ xZ	S )AsyncPipelinez0Handler for (async) connection in pipeline mode.r   AsyncConnection[Any]_connFconn_no_lockboolr   r   c                    t                                          |           |rt                      n|j        | _        d S r   )super__init__r   lock_lock)r   r*   r+   	__class__s      r   r/   zAsyncPipeline.__init__*   s5    %-<Z\\\49


r   c                ,  K   	 | j         4 d{V  | j                            |                                            d{V  ddd          d{V  dS # 1 d{V swxY w Y   dS # t          j        $ r}|                    d          d}~ww xY w)zkSync the pipeline, send any pending command and receive and process
        all available results.
        N)r1   r)   wait	_sync_gene_NO_TRACEBACKwith_traceback)r   exs     r   synczAsyncPipeline.sync.   s6     	*z 8 8 8 8 8 8 8 8joodnn&6&67777777778 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 	* 	* 	*##D)))	*s:   A* 3AA* 
A!!A* $A!%A* *B9BBr	   c                   K   | j         4 d {V  | j                            |                                            d {V  d d d           d {V  n# 1 d {V swxY w Y   | S r   )r1   r)   r4   
_enter_genr   s    r   r   zAsyncPipeline.__aenter__8   s      : 	5 	5 	5 	5 	5 	5 	5 	5*//$//"3"3444444444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5s   3A
A"Ar   r   r   r   r   r   c                  K   	 | j         4 d {V  | j                            |                                            d {V  d d d           d {V  n# 1 d {V swxY w Y   nK# t          $ r>}|rt
                              d| |           n|                    d           Y d }~nd }~ww xY w|                     |           d S # |                     |           w xY w)Nz error ignored terminating %r: %s)	r1   r)   r4   	_exit_gen	Exceptionloggerwarningr8   _exit)r   r   r   r   exc2s        r   r    zAsyncPipeline.__aexit__=   s     
	 z 8 8 8 8 8 8 8 8joodnn&6&67777777778 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 	0 	0 	0 0A4NNNN))$/// ONNNN	0 JJwDJJwsR   A( 3AA( 
A  A( #A $A( 'C
 (
B024B+&C
 +B00C
 
C!)F)r*   r(   r+   r,   r   r   r!   )r   r	   r"   )
r#   r$   r%   __doc____annotations__r/   r:   r   r    __classcell__)r2   s   @r   r'   r'   $   s         ::J= = = = = = =* * * *   
               r   r'   )rD   
__future__r   loggingtypesr   typingr   r    r   r6   _compatr	   _pipeline_baser
   connection_asyncr   	getLoggerr@   r   r'   r   r   r   <module>rP      s    # " " " " "        % % % % % % % %             ( ( ( ( ( ( 2111111		9	%	%
 
 
 
 
 
 
 
)  )  )  )  ) L )  )  )  )  ) r   