Hacked By AnonymousFox
B
� fC � @ s~ d Z ddlZddlZddlmZ ddlmZ G dd� de�ZG dd � d e�ZG d
d� d�Z G dd
� d
e �Z
G dd� de �ZdS ))�Queue�
PriorityQueue� LifoQueue� QueueFull�
QueueEmpty� N� )�events)�locksc @ s e Zd ZdZdS )r z;Raised when Queue.get_nowait() is called on an empty Queue.N)�__name__�
__module__�__qualname__�__doc__� r r �3/opt/alt/python37/lib64/python3.7/asyncio/queues.pyr
s r c @ s e Zd ZdZdS )r zDRaised when the Queue.put_nowait() method is called on a full Queue.N)r
r r r
r r r r r s r c @ s� e Zd ZdZd)dd�dd�Zdd� Zd d
� Zdd� Zd
d� Zdd� Z dd� Z
dd� Zdd� Ze
dd� �Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� ZdS )*r a A queue, useful for coordinating producer and consumer coroutines.
If maxsize is less than or equal to zero, the queue size is infinite. If it
is an integer greater than 0, then "await put()" will block when the
queue reaches maxsize, until an item is removed by get().
Unlike the standard library Queue, you can reliably know this Queue's size
with qsize(), since your single-threaded asyncio application won't be
interrupted between calling qsize() and doing an operation on the Queue.
r N)�loopc C sb |d krt �� | _n|| _|| _t�� | _t�� | _d| _t j
| jd�| _| j�� | �
|� d S )Nr )r )r Zget_event_loop�_loop�_maxsize�collections�deque�_getters�_putters�_unfinished_tasksr ZEvent� _finished�set�_init)�self�maxsizer r r r �__init__ s
zQueue.__init__c C s t �� | _d S )N)r r �_queue)r r r r r r 2 s zQueue._initc C s
| j �� S )N)r �popleft)r r r r �_get5 s z
Queue._getc C s | j �|� d S )N)r �append)r �itemr r r �_put8 s z
Queue._putc C s* x$|r$|� � }|�� s|�d � P qW d S )N)r ZdoneZ
set_result)r �waitersZwaiterr r r �_wakeup_next= s
zQueue._wakeup_nextc C s( dt | �j� dt| �d�d| �� � d�S )N�<z at z#x� �>)�typer
�id�_format)r r r r �__repr__E s zQueue.__repr__c C s dt | �j� d| �� � d�S )Nr&