%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/asyncio/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/asyncio/__pycache__/queues.cpython-312.pyc

�

���f&���dZddlZddlZddlmZddlmZddlmZGd�de�Z	Gd	�d
e�Z
Gd�dej�ZGd
�de�Z
Gd�de�Zy))�Queue�
PriorityQueue�	LifoQueue�	QueueFull�
QueueEmpty�N)�GenericAlias�)�locks)�mixinsc��eZdZdZy)rz;Raised when Queue.get_nowait() is called on an empty Queue.N��__name__�
__module__�__qualname__�__doc__���%/usr/lib/python3.12/asyncio/queues.pyrrs��E�rrc��eZdZdZy)rzDRaised when the Queue.put_nowait() method is called on a full Queue.Nr
rrrrrs��N�rrc��eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ee�Z
d	�Zd
�Zed��Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zy)raA 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.
    c��||_tj�|_tj�|_d|_t
j�|_|jj�|j|�y)Nr)�_maxsize�collections�deque�_getters�_putters�_unfinished_tasksr
�Event�	_finished�set�_init��self�maxsizes  r�__init__zQueue.__init__!s\����
�$�)�)�+��
�#�)�)�+��
�!"����������������
�
�7�rc�6�tj�|_y�N)rr�_queuer"s  rr!zQueue._init/s��!�'�'�)��rc�6�|jj�Sr')r(�popleft�r#s r�_getz
Queue._get2s���{�{�"�"�$�$rc�:�|jj|�yr'�r(�append�r#�items  r�_putz
Queue._put5��������4� rc�t�|r6|j�}|j�s|jd�y|r�5yyr')r*�done�
set_result)r#�waiters�waiters   r�_wakeup_nextzQueue._wakeup_next:s0����_�_�&�F��;�;�=��!�!�$�'��	rc�p�dt|�j�dt|�d�d|j��d�S)N�<z at z#x� �>)�typer�id�_formatr+s r�__repr__zQueue.__repr__Bs5���4��:�&�&�'�t�B�t�H�R�=��$�,�,�.�9I��K�Krc�V�dt|�j�d|j��d�S)Nr;r<r=)r>rr@r+s r�__str__z
Queue.__str__Es)���4��:�&�&�'�q�����(8��:�:rc�P�d|j��}t|dd�r|dt|j���z
}|jr|dt|j��d�z
}|jr|dt|j��d�z
}|jr|d|j��z
}|S)Nzmaxsize=r(z _queue=z
 _getters[�]z
 _putters[z tasks=)r�getattr�listr(r�lenrr)r#�results  rr@z
Queue._formatJs����D�M�M�,�-���4��4�(����d�k�k�!2� 5�6�6�F��=�=��
�3�t�}�}�#5�"6�a�8�8�F��=�=��
�3�t�}�}�#5�"6�a�8�8�F��!�!���� 6� 6�7�8�8�F��
rc�,�t|j�S)zNumber of items in the queue.)rHr(r+s r�qsizezQueue.qsizeVs���4�;�;��rc��|jS)z%Number of items allowed in the queue.)rr+s rr$z
Queue.maxsizeZs���}�}�rc��|jS)z3Return True if the queue is empty, False otherwise.�r(r+s r�emptyzQueue.empty_s���;�;��rc�\�|jdkry|j�|jk\S)z�Return True if there are maxsize items in the queue.

        Note: if the Queue was initialized with maxsize=0 (the default),
        then full() is never True.
        rF)rrKr+s r�fullz
Queue.fullcs(���=�=�A����:�:�<�4�=�=�0�0rc���K�|j�rU|j�j�}|jj	|�	|�d{���|j�r�U|j|�S7�&#|j�	|jj
|�n#t$rYnwxYw|j�s+|j�s|j|j��xYw�w)z�Put an item into the queue.

        Put an item into the queue. If the queue is full, wait until a free
        slot is available before adding item.
        N)rQ�	_get_loop�
create_futurerr/�cancel�remove�
ValueError�	cancelledr9�
put_nowait)r#r1�putters   r�putz	Queue.putns������i�i�k��^�^�%�3�3�5�F��M�M� � ��(�
����	�i�i�k�&���t�$�$���

��
�
����M�M�(�(��0��!������y�y�{�6�+;�+;�+=��%�%�d�m�m�4��sZ�A
C8�
A;�A9�A;�C8�(C8�9A;�;C5�B*�)C5�*	B6�3C5�5B6�6?C5�5C8c���|j�rt�|j|�|xjdz
c_|jj�|j
|j�y)zyPut an item into the queue without blocking.

        If no free slot is immediately available, raise QueueFull.
        r	N)rQrr2rr�clearr9rr0s  rrYzQueue.put_nowait�sP��
�9�9�;��O��	�	�$�����!�#�����������$�-�-�(rc���K�|j�rU|j�j�}|jj	|�	|�d{���|j�r�U|j�S7�%#|j�	|jj
|�n#t$rYnwxYw|j�s+|j�s|j|j��xYw�w)zoRemove and return an item from the queue.

        If queue is empty, wait until an item is available.
        N)rOrSrTrr/rUrVrWrXr9�
get_nowait)r#�getters  r�getz	Queue.get�s�����
�j�j�l��^�^�%�3�3�5�F��M�M� � ��(�
����	�j�j�l�&��� � ���

��
�
����M�M�(�(��0��!������z�z�|�F�,<�,<�,>��%�%�d�m�m�4��sZ�A
C7�
A:�A8�A:�C7�(C7�8A:�:C4�
B)�(C4�)	B5�2C4�4B5�5?C4�4C7c��|j�rt�|j�}|j|j�|S)z�Remove and return an item from the queue.

        Return an item if one is immediately available, else raise QueueEmpty.
        )rOrr,r9rr0s  rr_zQueue.get_nowait�s5��
�:�:�<����y�y�{�����$�-�-�(��rc��|jdkrtd��|xjdzc_|jdk(r|jj�yy)a$Indicate that a formerly enqueued task is complete.

        Used by queue consumers. For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items have
        been processed (meaning that a task_done() call was received for every
        item that had been put() into the queue).

        Raises ValueError if called more times than there were items placed in
        the queue.
        rz!task_done() called too many timesr	N)rrWrr r+s r�	task_donezQueue.task_done�sR���!�!�Q�&��@�A�A����!�#���!�!�Q�&��N�N��� �'rc��tK�|jdkDr#|jj��d{���yy7��w)aBlock until all items in the queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer calls task_done() to
        indicate that the item was retrieved and all work on it is complete.
        When the count of unfinished tasks drops to zero, join() unblocks.
        rN)rr�waitr+s r�joinz
Queue.join�s4�����!�!�A�%��.�.�%�%�'�'�'�&�'�s�-8�6�8N)r)rrrrr%r!r,r2r9rArC�classmethodr�__class_getitem__r@rK�propertyr$rOrQr[rYrar_rdrgrrrrrs~��	�
�*�%�!�
�L�;�$�L�1��
� ������	1�%�6
)�!�4	�!�(	(rrc�R�eZdZdZd�Zejfd�Zejfd�Z	y)rz�A subclass of Queue; retrieves entries in priority order (lowest first).

    Entries are typically tuples of the form: (priority number, data).
    c��g|_yr'rNr"s  rr!zPriorityQueue._init��	����rc�*�||j|�yr'rN)r#r1�heappushs   rr2zPriorityQueue._put�s������d�#rc�&�||j�Sr'rN)r#�heappops  rr,zPriorityQueue._get�s���t�{�{�#�#rN)
rrrrr!�heapqror2rqr,rrrrr�s(���
�#(�.�.�$�!�=�=�$rrc�"�eZdZdZd�Zd�Zd�Zy)rzEA subclass of Queue that retrieves most recently added entries first.c��g|_yr'rNr"s  rr!zLifoQueue._init�rmrc�:�|jj|�yr'r.r0s  rr2zLifoQueue._put�r3rc�6�|jj�Sr')r(�popr+s rr,zLifoQueue._get�s���{�{��� � rN)rrrrr!r2r,rrrrr�s��O��!�!rr)�__all__rrr�typesr�r
r�	Exceptionrr�_LoopBoundMixinrrrrrr�<module>r}s^��
L�������	��	�
	�	�	�
B(�F�"�"�B(�J
$�E�
$� 
!��
!r

Zerion Mini Shell 1.0