File: //proc/self/root/usr/local/lib/python3.9/site-packages/vine/__pycache__/abstract.cpython-39.pyc
a
X>hT � @ sL d Z ddlZddlmZ dgZG dd� deejd�ZejG dd� d��ZdS ) zAbstract classes.� N)�Callable�Thenablec @ sZ e Zd ZdZdZejddd��Zejddd��Zejd d
� �Z e
dd� �Ze
d
d� �ZdS )r z!Object that supports ``.then()``.� Nc C s
t � �d S �N��NotImplementedError��selfZ
on_successZon_errorr r �7/usr/local/lib/python3.9/site-packages/vine/abstract.py�then
s z
Thenable.thenTc C s
t � �d S r r �r �exc�tb� propagater r r
�throw s zThenable.throwc C s
t � �d S r r �r r r r
�cancel s zThenable.cancelc C s$ | t u r tdd� |jD ��r dS tS )Nc s s | ]}d |j v V qdS )r N)�__dict__)�.0�Br r r
� <genexpr> � z,Thenable.__subclasshook__.<locals>.<genexpr>T)r �any�__mro__�NotImplemented)�cls�Cr r r
�__subclasshook__ s zThenable.__subclasshook__c C s t | ��| |� |S r )�type�register)r �otherr r r
r s zThenable.register)N)NNT)
�__name__�
__module__�__qualname__�__doc__� __slots__�abc�abstractmethodr r r �classmethodr r r r r r
r s
)� metaclassc @ sb e Zd ZdZdd� Zddd�Zdd� Zdd d
�Zddd
�Ze dd� �Z
e dd� �Ze dd� �ZdS )�
ThenableProxyz*Proxy to object that supports ``.then()``.c C s
|| _ d S r )�_p)r �pr r r
�_set_promise_target+ s z!ThenableProxy._set_promise_targetNc C s | j �||�S r )r+ r r r r r
r . s zThenableProxy.thenc C s
| j �� S r )r+ r r r r r
r 1 s zThenableProxy.cancelc C s | j �|�S r )r+ �throw1)r r
r r r
r. 4 s zThenableProxy.throw1Tc C s | j j|||d�S )N)r r )r+ r r r r r
r 7 s zThenableProxy.throwc C s | j jS r )r+ � cancelledr r r r
r/ : s zThenableProxy.cancelledc C s | j jS r )r+ �readyr r r r
r0 >