403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.148.217.26
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/util/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/util/__pycache__/queue.cpython-37.pyc
B

��4]��@sddZddlmZddlmZddlmZdddgZGd	d�de�Z	Gd
d�de�Z
Gdd�d�ZdS)
a�An adaptation of Py2.3/2.4's Queue module which supports reentrant
behavior, using RLock instead of Lock for its mutex object.  The
Queue object is used exclusively by the sqlalchemy.pool.QueuePool
class.

This is to support the connection pool's usage of weakref callbacks to return
connections to the underlying Queue, which can in extremely
rare cases be invoked within the ``get()`` method of the Queue itself,
producing a ``put()`` inside the ``get()`` and therefore a reentrant
condition.

�)�deque)�time�)�	threading�Empty�Full�Queuec@seZdZdZdS)rz4Exception raised by Queue.get(block=0)/get_nowait().N)�__name__�
__module__�__qualname__�__doc__�r
r
�H/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/util/queue.pyrsc@seZdZdZdS)rz4Exception raised by Queue.put(block=0)/put_nowait().N)r	r
rrr
r
r
rr$sc@s�eZdZd!dd�Zdd�Zdd�Zd	d
�Zd"d
d�Zdd�Zd#dd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �ZdS)$rrFcCs:|�|�t��|_t�|j�|_t�|j�|_||_dS)z�Initialize a queue object with a given maximum size.

        If `maxsize` is <= 0, the queue size is infinite.

        If `use_lifo` is True, this Queue acts like a Stack (LIFO).
        N)�_initr�RLock�mutex�	Condition�	not_empty�not_full�use_lifo)�self�maxsizerr
r
r�__init__+s


zQueue.__init__cCs |j��|��}|j��|S)z9Return the approximate size of the queue (not reliable!).)r�acquire�_qsize�release)r�nr
r
r�qsizeBs

zQueue.qsizecCs |j��|��}|j��|S)zKReturn True if the queue is empty, False otherwise (not
        reliable!).)rr�_emptyr)rrr
r
r�emptyJs

zQueue.emptycCs |j��|��}|j��|S)zJReturn True if the queue is full, False otherwise (not
        reliable!).)rr�_fullr)rrr
r
r�fullSs

z
Queue.fullTNcCs�|j��z�|s|��r�t�nl|dkr@xb|��r<|j��q(WnJ|dkrPtd��t�|}x.|��r�|t�}|dkrzt�|j�|�q\W|�|�|j�	�Wd|j�
�XdS)aPut an item into the queue.

        If optional args `block` is True and `timeout` is None (the
        default), block if necessary until a free slot is
        available. If `timeout` is a positive number, it blocks at
        most `timeout` seconds and raises the ``Full`` exception if no
        free slot was available within that time.  Otherwise (`block`
        is false), put an item on the queue if a free slot is
        immediately available, else raise the ``Full`` exception
        (`timeout` is ignored in that case).
        Nrz#'timeout' must be a positive numberg)rrr r�wait�
ValueError�_time�_putr�notifyr)r�item�block�timeout�endtime�	remainingr
r
r�put\s&





z	Queue.putcCs|�|d�S)z�Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the ``Full`` exception.
        F)r,)rr'r
r
r�
put_nowaitszQueue.put_nowaitcCs�|j��z�|s|��r�t�nl|dkr@xb|��r<|j��q(WnJ|dkrPtd��t�|}x.|��r�|t�}|dkrzt�|j�|�q\W|��}|j�	�|S|j�
�XdS)aRemove and return an item from the queue.

        If optional args `block` is True and `timeout` is None (the
        default), block if necessary until an item is available. If
        `timeout` is a positive number, it blocks at most `timeout`
        seconds and raises the ``Empty`` exception if no item was
        available within that time.  Otherwise (`block` is false),
        return an item if one is immediately available, else raise the
        ``Empty`` exception (`timeout` is ignored in that case).
        Nrz#'timeout' must be a positive numberg)rrrrr"r#r$�_getrr&r)rr(r)r*r+r'r
r
r�get�s(





z	Queue.getcCs
|�d�S)z�Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the ``Empty`` exception.
        F)r/)rr
r
r�
get_nowait�szQueue.get_nowaitcCs||_t�|_dS)N)rr�queue)rrr
r
rr�szQueue._initcCs
t|j�S)N)�lenr1)rr
r
rr�szQueue._qsizecCs|jS)N)r1)rr
r
rr�szQueue._emptycCs|jdkot|j�|jkS)Nr)rr2r1)rr
r
rr �szQueue._fullcCs|j�|�dS)N)r1�append)rr'r
r
rr%�sz
Queue._putcCs|jr|j��S|j��SdS)N)rr1�pop�popleft)rr
r
rr.�s
z
Queue._get)rF)TN)TN)r	r
rrrrr!r,r-r/r0rrrr r%r.r
r
r
rr*s
		
#
"N)r�collectionsrrr$�compatr�__all__�	Exceptionrrrr
r
r
r�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit