Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /usr/local/lib/python3.9/site-packages/vine/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.9/site-packages/vine/__pycache__/synchronization.cpython-39.pyc
a

��Sh��@s>dZddlmZddlmZdgZGdd�d�Ze�e�dS)zSynchronization primitives.�)�Thenable)�promise�barrierc@sXeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dd�ZeZdS)ra�Barrier.

    Synchronization primitive to call a callback after a list
    of promises have been fulfilled.

    Example:

    .. code-block:: python

        # Request supports the .then() method.
        p1 = http.Request('http://a')
        p2 = http.Request('http://b')
        p3 = http.Request('http://c')
        requests = [p1, p2, p3]

        def all_done():
            pass  # all requests complete

        b = barrier(requests).then(all_done)

        # oops, we forgot we want another request
        b.add(http.Request('http://d'))

    Note that you cannot add new promises to a barrier after
    the barrier is fulfilled.
    Ncs�t��_|pd�_|pi�_d�_|p(d�_�jsL|rL|��}|turL|�_d�_�_	d�_
d�_d�_�fdd�|pzgD�t
|p��j��_|r���|�d}dS)N��Fcsg|]}��|��qSr)�
add_noincr)�.0�p��selfr�>/usr/local/lib/python3.9/site-packages/vine/synchronization.py�
<listcomp>7�z$barrier.__init__.<locals>.<listcomp>)r	�args�kwargs�_value�size�ready�reason�	cancelled�	finalized�__weakref__�__dict__)rr	rrrr�__len__�NotImplementedr�failedrrr�bool�then)r�promisesrr�callbackr�plen�	__slots__rr
r�__init__$s$




zbarrier.__init__cOsJ|jsF|jsF|jd7_|jrF|j|jkrFd|_|j|ji|j��dS)NrT)rrrrrr	rr�rrrrrr�__call__Ds
zbarrier.__call__cCs0|js&|j|jkr&|j|ji|j��d|_dS�NT)rrrr	rrr
rrr�finalizeKszbarrier.finalizecCsd|_|j��dSr%)rr	�cancelr
rrrr'Pszbarrier.cancelcCs"|js|jrtd��|�|�dS)Nz"Cannot add promise to full barrier)rr�
ValueErrorr�rr	rrrrTszbarrier.add_noincrcCs"|js|�|�|jd7_dS)Nr)rrrr)rrr�addZs
zbarrier.addcCs|j�||�dS�N)r	r)rrZerrbackrrrr_szbarrier.thencOs|js|jj|i|��dSr+)rr	�throwr#rrrr,bsz
barrier.throw)NNNNN)N)
�__name__�
__module__�__qualname__�__doc__r"r$r&r'rr*rr,Zthrow1rrrrrs�
 
N)r0Zabstractrrr�__all__r�registerrrrr�<module>s
`

Yohohohohohooho | Sanrei Aya