a
´iq ã @ s’ d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ G dd„ de ƒZ
G d d
„ d
e ƒZG dd„ dƒZG d
d„ deƒZ
G dd„ deƒZdS ))ÚQueueÚ
PriorityQueueÚ LifoQueueÚ QueueFullÚ
QueueEmptyé N)ÚGenericAliasé )Ú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 ú&/usr/lib64/python3.9/asyncio/queues.pyr s r c @ s e Zd ZdZdS )r zDRaised when the Queue.put_nowait() method is called on a full Queue.Nr r r r r r s r c @ s´ e Zd ZdZd)ddœdd„Zdd„ Zd d
„ Zdd„ Zd
d„ Zdd„ Z dd„ Z
eeƒZ
dd„ Zdd„ Zedd„ ƒ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 sp |d u rt ¡ | _n|| _tjdtdd� || _t ¡ | _ t ¡ | _
d| _tj
|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 Zget_event_loopÚ_loopÚwarningsÚwarnÚDeprecationWarningÚ_maxsizeÚcollectionsÚdequeÚ_gettersÚ_puttersÚ_unfinished_tasksr
ÚEventÚ _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# 7 s zQueue._initc C s
| j ¡ S r' )r( Úpopleft©r$ r r r Ú_get: s z
Queue._getc C s | j |¡ d S r' ©r( Úappend©r$ Úitemr r r Ú_put= s z
Queue._putc C s&