
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,a   ã                   @   s†   d Z ddlZddlZddlZddlmZ ddlmZ G dd„ deƒZG dd	„ d	eƒZ	G d
d„ dƒZ
G dd„ de
ƒZG dd„ de
ƒZdS ))ÚQueueÚPriorityQueueÚ	LifoQueueÚ	QueueFullÚ
QueueEmptyé    Né   )Úevents)Úlocksc                   @   s   e Zd ZdS )r   N©Ú__name__Ú
__module__Ú__qualname__© r   r   ú3/opt/alt/python38/lib64/python3.8/asyncio/queues.pyr      s   r   c                   @   s   e Zd ZdS )r   Nr
   r   r   r   r   r      s   r   c                   @   s¨   e Zd Zd(ddœdd„Zdd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zedd„ ƒZdd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Zd&d'„ ZdS ))r   r   N©Úloopc                C   sp   |d krt  ¡ | _n|| _tjdtdd� || _t ¡ | _	t ¡ | _
d| _tj|d�| _| j ¡  |  |¡ d S )Nz[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.é   )Ú
stacklevelr   r   )r   Zget_event_loopÚ_loopÚwarningsÚwarnÚDeprecationWarningÚ_maxsizeÚcollectionsÚdequeÚ_gettersÚ_puttersÚ_unfinished_tasksr	   ZEventÚ	_finishedÚsetÚ_init)ÚselfÚmaxsizer   r   r   r   Ú__init__!   s     þ


zQueue.__init__c                 C   s   t  ¡ | _d S ©N)r   r   Ú_queue©r!   r"   r   r   r   r    6   s    zQueue._initc                 C   s
   | j  ¡ S r$   )r%   Úpopleft©r!   r   r   r   Ú_get9   s    z
Queue._getc                 C   s   | j  |¡ d S r$   ©r%   Úappend©r!   Úitemr   r   r   Ú_put<   s    z
Queue._putc                 C   s&   |r"|  ¡ }| ¡ s | d ¡ q"q d S r$   )r'   ZdoneZ
set_result)r!   ÚwaitersZwaiterr   r   r   Ú_wakeup_nextA   s
    
zQueue._wakeup_nextc                 C   s(   dt | ƒj› dt| ƒd›d|  ¡ › d�S )Nú<z at z#xú ú>)Útyper   ÚidÚ_formatr(   r   r   r   Ú__repr__I   s    zQueue.__repr__c                 C   s   dt | ƒj› d|  ¡ › d�S )Nr1   r2   r3   )r4   r   r6   r(   r   r   r   Ú__str__L   s    zQueue.__str__c                 C   s~   d| j ›�}t| dd ƒr,|dt| jƒ›�7 }| jrH|dt| jƒ› d�7 }| jrd|dt| jƒ› d�7 }| jrz|d| j› �7 }|S )Nzmaxsize=r%   z _queue=z
 _getters[ú]z
 _putters[z tasks=)r   ÚgetattrÚlistr%   r   Úlenr   r   )r!   Úresultr   r   r   r6   O   s    zQueue._formatc                 C   s
   t | jƒS r$   )r<   r%   r(   r   r   r   Úqsize[   s    zQueue.qsizec                 C   s   | j S r$   )r   r(   r   r   r   r"   _   s    zQueue.maxsizec                 C   s   | j  S r$   ©r%   r(   r   r   r   Úemptyd   s    zQueue.emptyc                 C   s    | j dkrdS |  ¡ | j kS d S )Nr   F)r   r>   r(   r   r   r   Úfullh   s    
z
Queue.fullc                 Ã   s’   |   ¡ rˆ| j ¡ }| j |¡ z|I d H  W q    | ¡  z| j |¡ W n tk
r`   Y nX |   ¡ s~| ¡ s~|  	| j¡ ‚ Y q X q |  
|¡S r$   )rA   r   Úcreate_futurer   r+   ÚcancelÚremoveÚ
ValueErrorÚ	cancelledr0   Ú
put_nowait)r!   r-   Zputterr   r   r   Úputs   s    

z	Queue.putc                 C   s>   |   ¡ rt‚|  |¡ |  jd7  _| j ¡  |  | j¡ d S )Nr   )rA   r   r.   r   r   Úclearr0   r   r,   r   r   r   rG   Ž   s    

zQueue.put_nowaitc                 Ã   s�   |   ¡ rˆ| j ¡ }| j |¡ z|I d H  W q    | ¡  z| j |¡ W n tk
r`   Y nX |   ¡ s~| ¡ s~|  	| j¡ ‚ Y q X q |  
¡ S r$   )r@   r   rB   r   r+   rC   rD   rE   rF   r0   Ú
get_nowait)r!   Úgetterr   r   r   Úgetš   s    

z	Queue.getc                 C   s$   |   ¡ rt‚|  ¡ }|  | j¡ |S r$   )r@   r   r)   r0   r   r,   r   r   r   rJ   ´   s
    zQueue.get_nowaitc                 C   s8   | j dkrtdƒ‚|  j d8  _ | j dkr4| j ¡  d S )Nr   z!task_done() called too many timesr   )r   rE   r   r   r(   r   r   r   Ú	task_done¿   s
    

zQueue.task_donec                 Ã   s   | j dkr| j ¡ I d H  d S )Nr   )r   r   Úwaitr(   r   r   r   ÚjoinÓ   s    
z
Queue.join)r   )r   r   r   r#   r    r)   r.   r0   r7   r8   r6   r>   Úpropertyr"   r@   rA   rH   rG   rL   rJ   rM   rO   r   r   r   r   r      s&   
r   c                   @   s0   e Zd Zdd„ Zejfdd„Zejfdd„ZdS )r   c                 C   s
   g | _ d S r$   r?   r&   r   r   r   r    å   s    zPriorityQueue._initc                 C   s   || j |ƒ d S r$   r?   )r!   r-   Úheappushr   r   r   r.   è   s    zPriorityQueue._putc                 C   s
   || j ƒS r$   r?   )r!   Úheappopr   r   r   r)   ë   s    zPriorityQueue._getN)	r   r   r   r    ÚheapqrQ   r.   rR   r)   r   r   r   r   r   ß   s   r   c                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )r   c                 C   s
   g | _ d S r$   r?   r&   r   r   r   r    ò   s    zLifoQueue._initc                 C   s   | j  |¡ d S r$   r*   r,   r   r   r   r.   õ   s    zLifoQueue._putc                 C   s
   | j  ¡ S r$   )r%   Úpopr(   r   r   r   r)   ø   s    zLifoQueue._getN)r   r   r   r    r.   r)   r   r   r   r   r   ï   s   r   )Ú__all__r   rS   r   Ú r   r	   Ú	Exceptionr   r   r   r   r   r   r   r   r   Ú<module>   s    K