HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyc
�
���ec@sdZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lm
Z
ddd
gZdefd��YZdefd��YZd
dd��YZddd��YZdefd��YZdS(s�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.

i����(tdeque(ttimei(tcompat(t	threading(tasyncio(tawait_fallback(t
await_only(tmemoized_propertytEmptytFulltQueuecBseZdZRS(s4Exception raised by Queue.get(block=0)/get_nowait().(t__name__t
__module__t__doc__(((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR#scBseZdZRS(s4Exception raised by Queue.put(block=0)/put_nowait().(RRR
(((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR	)scBs�eZded�Zd�Zd�Zd�Zedd�Z	d�Z
edd�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�ZRS(icCsS|j|�tj�|_tj|j�|_tj|j�|_||_dS(s�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(t_initRtRLocktmutext	Conditiont	not_emptytnot_fulltuse_lifo(tselftmaxsizeR((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyt__init__0s

cCs|j�|j�SWdQXdS(s9Return the approximate size of the queue (not reliable!).N(Rt_qsize(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pytqsizeGs
cCs|j�|j�SWdQXdS(sKReturn True if the queue is empty, False otherwise (not
        reliable!).N(Rt_empty(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pytemptyMs
cCs|j�|j�SWdQXdS(sJReturn True if the queue is full, False otherwise (not
        reliable!).N(Rt_full(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pytfullTs
cCs�|j��|s(|j�r�t�q�n�|dkrWx�|j�rS|jj�q7Wnm|dkrrtd��nt�|}xB|j�r�|t�}|dkr�t�n|jj|�q�W|j|�|jj	�WdQXdS(sPut 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).
        is#'timeout' must be a positive numbergN(
RRR	tNonetwaitt
ValueErrort_timet_putRtnotify(Rtitemtblockttimeouttendtimet	remaining((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pytput[s"


	
cCs|j|t�S(s�Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the ``Full`` exception.
        (R)tFalse(RR$((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyt
put_nowait{scCs�|j��|s(|j�r�t�q�n�|dkrWx�|j�rS|jj�q7Wnm|dkrrtd��nt�|}xB|j�r�|t�}|dkr�t�n|jj|�q�W|j�}|jj	�|SWdQXdS(s
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).

        is#'timeout' must be a positive numbergN(
RRRRRR R!t_getRR#(RR%R&R'R(R$((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pytget�s$


	
cCs
|jt�S(s�Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the ``Empty`` exception.
        (R-R*(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyt
get_nowait�scCs||_t�|_dS(N(RRtqueue(RR((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�s	cCs
t|j�S(N(tlenR/(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�scCs|jS(N(R/(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�scCs%|jdko$t|j�|jkS(Ni(RR0R/(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�scCs|jj|�dS(N(R/tappend(RR$((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR"�scCs'|jr|jj�S|jj�SdS(N(RR/tpoptpopleft(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR,�s	
N(RRR*RRRRtTrueRR)R+R-R.RRRRR"R,(((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR
/s			 	 						tAsyncAdaptedQueuecBs}eZee�Zded�Zd�Zd�Zd�Z	e
d��Zd�Ze
d
d�Zd�Ze
d
d	�ZRS(icCs||_||_dS(N(RR(RRR((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�s	cCs
|jj�S(N(t_queueR(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�scCs
|jj�S(N(R6R(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�scCs
|jj�S(N(R6R(R((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR�scCs:|jr!tjd|j�}ntjd|j�}|S(NR(RRt	LifoQueueRR
(RR/((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR6�s		cCsGy|jj|�SWn,tjk
rB}tjt�d|�nXdS(Ntreplace_context(R6R+Rt	QueueFullRtraise_R	(RR$terr((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR+�s	cCs�|s|j|�SyN|dk	rG|jtj|jj|�|��S|j|jj|��SWn5tjtjfk
r�}t	j
t�d|�nXdS(NR8(R+Rtawait_Rtwait_forR6R)R9tTimeoutErrorRR:R	(RR$R%R&R;((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR)�s
	cCsDy|jj�SWn,tjk
r?}tjt�d|�nXdS(NR8(R6R.Rt
QueueEmptyRR:R(RR;((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR.s	cCs�|s|j�SyH|dk	rA|jtj|jj�|��S|j|jj��SWn5tjtjfk
r�}t	j
t�d|�nXdS(NR8(R.RR<RR=R6R-R?R>RR:R(RR%R&R;((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR-s
	N(RRtstaticmethodRR<R*RRRRRR6R+R4RR)R.R-(((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyR5�s							tFallbackAsyncAdaptedQueuecBseZee�ZRS((RRR@RR<(((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyRA"sN(((R
tcollectionsRRR!tRRtconcurrencyRRRtlanghelpersRt__all__t	ExceptionRR	R
R5RA(((sF/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/util/queue.pyt<module>s�T