File: //lib64/python3.6/site-packages/tornado/__pycache__/queues.cpython-36.opt-1.pyc
3
��f�/ � @ s& d Z ddlZddlZddlZddlmZmZ ddlmZm Z ddl
mZ ddlm
Z
mZmZmZ ddlZejr�ddlmZmZmZmZ ed�Zd d
ddd
gZG dd
� d
e�ZG dd� de�Zee
deejf dd�dd�ZG dd� dee �ZG dd � d ee �ZG dd
� d
e�Z G dd� de�Z!dS )a� Asynchronous queues for coroutines. These classes are very similar
to those provided in the standard library's `asyncio package
<https://docs.python.org/3/library/asyncio-queue.html>`_.
.. warning::
Unlike the standard library's `queue` module, the classes defined here
are *not* thread-safe. To use these queues from another thread,
use `.IOLoop.add_callback` to transfer control to the `.IOLoop` thread
before calling any queue methods.
� N)�gen�ioloop)�Future�"future_set_result_unless_cancelled)�Event)�Union�TypeVar�Generic� Awaitable)�Deque�Tuple�List�Any�_T�Queue�
PriorityQueue� LifoQueue� QueueFull�
QueueEmptyc @ s e Zd ZdZdS )r z:Raised by `.Queue.get_nowait` when the queue has no items.N)�__name__�
__module__�__qualname__�__doc__� r r �/usr/lib64/python3.6/queues.pyr / s c @ s e Zd ZdZdS )r zBRaised by `.Queue.put_nowait` when a queue is at its maximum size.N)r r r r r r r r r 5 s )�future�timeout�returnc sD |r@d d�� fdd�}t jj� ��j||��� j��fdd�� d S )N)r c s � j � s� jtj� � d S )N)�doneZ
set_exceptionr �TimeoutErrorr )r r r �
on_timeout@ s z _set_timeout.<locals>.on_timeoutc s
� j ��S )N)Zremove_timeout)�_)�io_loop�timeout_handler r �<lambda>F s z_set_timeout.<locals>.<lambda>)r ZIOLoopZcurrentZadd_timeoutZadd_done_callback)r r r r )r r"