Files
aitsc/.venv/Lib/site-packages/sqlalchemy/pool/__pycache__/impl.cpython-312.pyc

241 lines
25 KiB
Plaintext
Raw Normal View History

2025-02-23 09:07:52 +08:00
<EFBFBD>
2025-08-29 00:34:40 +08:00
<00><19>hL<00><01><><00>dZddlmZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm
2025-02-23 09:07:52 +08:00
Z
dd lm Z dd
2025-08-29 00:34:40 +08:00
lm Z dd lm Z ddlZd d lmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZddlmZddlmZddlmZddlmZddlmZejrddl m!Z!Gd<1C>de<16>Z"Gd<1E>de"<22>Z#Gd <20>d!e#<23>Z$Gd"<22>d#e<16>Z%Gd$<24>d%e<16>Z&Gd&<26>d'e<16>Z'Gd(<28>d)e<16>Z(y)*zPool implementation classes.<2E>)<01> annotationsN)<01>Any)<01>cast)<01>List)<01>Optional)<01>Set)<01>Type)<01> TYPE_CHECKING)<01>Union<6F>)<01>_AsyncConnDialect)<01>_ConnectionFairy<72><01>_ConnectionRecord)<01>_CreatorFnType)<01>_CreatorWRecFnType)<01>ConnectionPoolEntry)<01>Pool)<01>PoolProxiedConnection<6F>)<01>exc)<01>util)<01>chop_traceback)<01>queue)<01>Literal)<01>DBAPIConnectionc<01><><00>eZdZUdZdZej Zded<ded< d dd<07>Z dd<08>Z
2025-02-23 09:07:52 +08:00
dd <09>Z dd
<EFBFBD>Z dd <0B>Z dd <0C>Zdd <0A>Zdd<0E>Zdd<0F>Zdd<10>Zdd<11>Zdd<12>Zdd<13>Zy) <20> QueuePoolaOA :class:`_pool.Pool`
that imposes a limit on the number of open connections.
:class:`.QueuePool` is the default pooling implementation used for
all :class:`_engine.Engine` objects other than SQLite with a ``:memory:``
database.
The :class:`.QueuePool` class **is not compatible** with asyncio and
:func:`_asyncio.create_async_engine`. The
:class:`.AsyncAdaptedQueuePool` class is used automatically when
using :func:`_asyncio.create_async_engine`, if no other kind of pool
is specified.
.. seealso::
:class:`.AsyncAdaptedQueuePool`
F<>1Type[sqla_queue.QueueCommon[ConnectionPoolEntry]]<5D> _queue_classz+sqla_queue.QueueCommon[ConnectionPoolEntry]<5D>_poolc <01><><00>tj||fi|<06><01>|j||<05><01>|_d|z
|_|dk(rdn||_||_tj<00>|_ y)a<>
Construct a QueuePool.
:param creator: a callable function that returns a DB-API
connection object, same as that of :paramref:`_pool.Pool.creator`.
:param pool_size: The size of the pool to be maintained,
defaults to 5. This is the largest number of connections that
will be kept persistently in the pool. Note that the pool
begins with no connections; once this number of connections
is requested, that number of connections will remain.
``pool_size`` can be set to 0 to indicate no size limit; to
disable pooling, use a :class:`~sqlalchemy.pool.NullPool`
instead.
:param max_overflow: The maximum overflow size of the
pool. When the number of checked-out connections reaches the
size set in pool_size, additional connections will be
returned up to this limit. When those additional connections
are returned to the pool, they are disconnected and
discarded. It follows then that the total number of
simultaneous connections the pool will allow is pool_size +
`max_overflow`, and the total number of "sleeping"
connections the pool will allow is pool_size. `max_overflow`
can be set to -1 to indicate no overflow limit; no limit
will be placed on the total number of concurrent
connections. Defaults to 10.
:param timeout: The number of seconds to wait before giving up
on returning a connection. Defaults to 30.0. This can be a float
but is subject to the limitations of Python time functions which
may not be reliable in the tens of milliseconds.
:param use_lifo: use LIFO (last-in-first-out) when retrieving
connections instead of FIFO (first-in-first-out). Using LIFO, a
server-side timeout scheme can reduce the number of connections used
during non-peak periods of use. When planning for server-side
timeouts, ensure that a recycle or pre-ping strategy is in use to
gracefully handle stale connections.
.. versionadded:: 1.3
.. seealso::
:ref:`pool_use_lifo`
:ref:`pool_disconnects`
:param \**kw: Other keyword arguments including
:paramref:`_pool.Pool.recycle`, :paramref:`_pool.Pool.echo`,
:paramref:`_pool.Pool.reset_on_return` and others are passed to the
:class:`_pool.Pool` constructor.
)<01>use_lifor<00><><EFBFBD><EFBFBD><EFBFBD>N)
2025-08-29 00:34:40 +08:00
r<00>__init__r r!<00> _overflow<6F> _max_overflow<6F>_timeout<75> threading<6E>Lock<63>_overflow_lock)<07>self<6C>creator<6F> pool_size<7A> max_overflow<6F>timeoutr#<00>kws <20>AD:\pythonpj\aitsc\.venv\Lib\site-packages\sqlalchemy/pool/impl.pyr%zQueuePool.__init__Gs`<00><00>@ <0A> <0A> <0A>d<EFBFBD>G<EFBFBD>*<2A>r<EFBFBD>*<2A><19>&<26>&<26>y<EFBFBD>8<EFBFBD>&<26>D<><04>
2025-02-23 09:07:52 +08:00
<EFBFBD><1A>Y<EFBFBD><1D><04><0E>#,<2C><01>><3E>R<EFBFBD>|<7C><04><1A><1F><04> <0A>'<27>n<EFBFBD>n<EFBFBD>.<2E><04><1B>c<01><><00> |jj|d<01>y#tj$r9 |j <00>|j <00>Yy#|j <00>wxYwwxYw<01>NF)r!<00>put<75>
2025-08-29 00:34:40 +08:00
sqla_queue<EFBFBD>Full<6C>close<73> _dec_overflow<6F>r,<00>records r2<00>_do_return_connzQueuePool._do_return_conn<6E>sS<00><00> %<25> <10>J<EFBFBD>J<EFBFBD>N<EFBFBD>N<EFBFBD>6<EFBFBD>5<EFBFBD> )<29><><19><EFBFBD><EFBFBD> %<25> %<25><16> <0C> <0C><0E><14>"<22>"<22>$<24><><04>"<22>"<22>$<24><>  %<25>s <00><00>A+<03>A<02>A+<03>A'<05>'A+c<01><><00>|jdkD}|xr|j|jk\} |jj||j<00>S#t
j $rYnwxYw|rn|j|jk\rU|s|j<00>Stjd|j<00>|j<00>|jfzd<03><04><00>|j<00>rP |j<00>S#tj<00>5|j!<00>ddd<00><00>#1swY<00>xYwxYw|j<00>S)Nr$zSQueuePool limit of size %d overflow %d reached, connection timed out, timeout %0.2f<EFBFBD>3o7r)<01>code)r'r&r!<00>getr(r7<00>Empty<74>_do_getr<00> TimeoutError<6F>size<7A>overflow<6F> _inc_overflow<6F>_create_connectionr<00> safe_reraiser:)r,<00> use_overflow<6F>waits r2rCzQueuePool._do_get<65>s"<00><00><1B>)<29>)<29>B<EFBFBD>.<2E> <0C><1B>D<><04><0E><0E>$<24>2D<32>2D<32> D<><04> <11><17>:<3A>:<3A>><3E>><3E>$<24><04> <0A> <0A>6<> 6<><36><19><1F><1F> <11> <11>  <11><>
<18>D<EFBFBD>N<EFBFBD>N<EFBFBD>d<EFBFBD>.@<40>.@<40>@<40><17><1B>|<7C>|<7C>~<7E>%<25><19>&<26>&<26>:<3A><1B>y<EFBFBD>y<EFBFBD>{<7B>D<EFBFBD>M<EFBFBD>M<EFBFBD>O<EFBFBD>T<EFBFBD>]<5D>]<5D>C<>D<01> <20> <12><12> <10> <1D> <1D> <1F> <16><1B>.<2E>.<2E>0<>0<><30> <16><19>&<26>&<26>(<28><18>&<26>&<26>(<28>)<29><15>)<29><15><><17><<3C><<3C>><3E> !s5<00>%A<00>A*<03>)A*<03>.C><00>>D:<03>D.<05>% D:<03>.D7 <09>3D:c<01><00>|jdk(r|xjdz c_y|j5|j|jkr|xjdz c_ ddd<00>y ddd<00>y#1swYyxYw)Nr$r TF<54>r'r&r+<00>r,s r2rGzQueuePool._inc_overflow<6F>sf<00><00> <0F> <1D> <1D><12> #<23> <10>N<EFBFBD>N<EFBFBD>a<EFBFBD> <1F>N<EFBFBD><17> <11> <20> <20><13>~<7E>~<7E><04> 2<> 2<>2<><14><0E><0E>!<21>#<23><0E><1B>!<21> <20>
<1D> !<21> <20> <20>s<00>0A5<03>+A5<03>5A>c<01><><00>|jdk(r|xjdzc_y|j5|xjdzc_ ddd<00>y#1swYyxYw)Nr$r TrMrNs r2r:zQueuePool._dec_overflow<6F>sG<00><00> <0F> <1D> <1D><12> #<23> <10>N<EFBFBD>N<EFBFBD>a<EFBFBD> <1F>N<EFBFBD><17> <11> <20> <20> <10>N<EFBFBD>N<EFBFBD>a<EFBFBD> <1F>N<EFBFBD><17>!<21> <20> <20>s <00>A<03>Ac<01><><00>|jjd<01>|j|j|jj
|j |j|jj|j|j|j|j|j|j|j<00><02> S)N<>Pool recreating) r.r/<00>pre_pingr#r0<00>recycle<6C>echo<68> logging_name<6D>reset_on_return<72> _dispatch<63>dialect)<10>logger<65>info<66> __class__<5F>_creatorr!<00>maxsizer'<00> _pre_pingr#r(<00>_recyclerT<00>_orig_logging_name<6D>_reset_on_return<72>dispatch<63>_dialectrNs r2<00>recreatezQueuePool.recreate<74>s<><00><00> <0C> <0B> <0B><18><18>*<2A>+<2B><13>~<7E>~<7E> <10>M<EFBFBD>M<EFBFBD><1A>j<EFBFBD>j<EFBFBD>(<28>(<28><1D>+<2B>+<2B><19>^<5E>^<5E><19>Z<EFBFBD>Z<EFBFBD>(<28>(<28><18>M<EFBFBD>M<EFBFBD><18>M<EFBFBD>M<EFBFBD><15><19><19><1D>0<>0<> <20>1<>1<><1A>m<EFBFBD>m<EFBFBD><18>M<EFBFBD>M<EFBFBD><1E> 
2025-02-23 09:07:52 +08:00
<EFBFBD>
r3c<01><00> |jjd<01>}|j<00><00>-#tj$rYnwxYwd|j <00>z
|_|jjd|j<00><00>y)NFrzPool disposed. %s)
2025-08-29 00:34:40 +08:00
r!rAr9r7rBrEr&rYrZ<00>status<75>r,<00>conns r2<00>disposezQueuePool.dispose<73>sr<00><00><12> <16><1B>z<EFBFBD>z<EFBFBD>~<7E>~<7E>e<EFBFBD>,<2C><04><14>
2025-02-23 09:07:52 +08:00
<EFBFBD>
<EFBFBD> <0C><13><><1E>#<23>#<23> <16><15> <16><><1B>T<EFBFBD>Y<EFBFBD>Y<EFBFBD>[<5B><1F><04><0E> <0C> <0B> <0B><18><18>,<2C>d<EFBFBD>k<EFBFBD>k<EFBFBD>m<EFBFBD><s<00>+/<00>A<03>Ac<01><><00>d|j<00>|j<00>|j<00>|j<00>fzS)Nz_Pool size: %d Connections in pool: %d Current Overflow: %d Current Checked out connections: %d)rE<00> checkedinrF<00>
2025-08-29 00:34:40 +08:00
checkedoutrNs r2rfzQueuePool.status<75>s><00><00> <1E><15> <09> <09> <0B><14><0E><0E> <20><14> <0A> <0A><0F><14><0F><0F>!<21> <0E> <0E>
2025-02-23 09:07:52 +08:00
2025-08-29 00:34:40 +08:00
r3c<01>.<00>|jjS<00>N)r!r]rNs r2rEzQueuePool.size<7A>s<00><00><13>z<EFBFBD>z<EFBFBD>!<21>!<21>!r3c<01><00>|jSrn)r(rNs r2r0zQueuePool.timeout<75>s <00><00><13>}<7D>}<7D>r3c<01>6<00>|jj<00>Srn)r!<00>qsizerNs r2rkzQueuePool.checkedin<69>s<00><00><13>z<EFBFBD>z<EFBFBD><1F><1F>!<21>!r3c<01>J<00>|jjr |jSdS)Nr)r!r]r&rNs r2rFzQueuePool.overflow<6F>s<00><00>!%<25><1A><1A>!3<>!3<>t<EFBFBD>~<7E>~<7E>:<3A><11>:r3c<01>~<00>|jj|jj<00>z
|jzSrn)r!r]rqr&rNs r2rlzQueuePool.checkedout<75>s-<00><00><13>z<EFBFBD>z<EFBFBD>!<21>!<21>D<EFBFBD>J<EFBFBD>J<EFBFBD>$4<>$4<>$6<>6<><14><1E><1E>G<>Gr3N)<04><00>
2025-02-23 09:07:52 +08:00
g>@F) r-<00>)Union[_CreatorFnType, _CreatorWRecFnType]r.<00>intr/rwr0<00>floatr#<00>boolr1r<00>r<r<00>return<72>None<6E>r{r)r{ry)r{z Literal[True])r{r<00>r{r|<00>r{<00>str)r{rw)r{rx)<16>__name__<5F>
2025-08-29 00:34:40 +08:00
__module__<EFBFBD> __qualname__<5F>__doc__<5F> _is_asyncior7<00>Queuer <00>__annotations__r%r=rCrGr:rdrirfrEr0rkrFrl<00>r3r2rr+s<><00><00><08>&<18>K<EFBFBD> <13><18><18><11>C<><06> 7<>6<>
2025-02-23 09:07:52 +08:00
<1B><1E><1D><1E> E/<2F>:<3A>E/<2F><17>E/<2F><1A> E/<2F>
<17> E/<2F> <17> E/<2F><12>E/<2F>N%<25>"<22>@ <1D><18>
<EFBFBD>" =<3D> 
<EFBFBD>"<22><1D>"<22>;<3B>Hr3rc<01>F<00>eZdZUdZdZej Zded<e <09>Z
y)<06>AsyncAdaptedQueuePoola<6C>An asyncio-compatible version of :class:`.QueuePool`.
This pool is used by default when using :class:`.AsyncEngine` engines that
were generated from :func:`_asyncio.create_async_engine`. It uses an
asyncio-compatible queue implementation that does not use
``threading.Lock``.
The arguments and operation of :class:`.AsyncAdaptedQueuePool` are
otherwise identical to that of :class:`.QueuePool`.
2025-08-29 00:34:40 +08:00
Trr N) r<>r<>r<>r<>r<>r7<00>AsyncAdaptedQueuer r<>r rcr<>r3r2r<>r<>s.<00><00>
<08><17>K<EFBFBD><12>$<24>$<24><11>C<><06>!<21>"<22>Hr3r<>c<01>$<00>eZdZejZy)<02>FallbackAsyncAdaptedQueuePoolN)r<>r<>r<>r7<00>FallbackAsyncAdaptedQueuer r<>r3r2r<>r<>s <00><00><1D>7<>7<>Lr3r<>c<01>8<00>eZdZdZdd<02>Zd d<03>Zd
2025-02-23 09:07:52 +08:00
d<04>Zd d<05>Zd d<06>Zy) <0A>NullPoola<6C>A Pool which does not pool connections.
Instead it literally opens and closes the underlying DB-API connection
per each connection open/close.
Reconnect-related functions such as ``recycle`` and connection
invalidation are not supported by this Pool implementation, since
no connections are held persistently.
The :class:`.NullPool` class **is compatible** with asyncio and
:func:`_asyncio.create_async_engine`.
2025-08-29 00:34:40 +08:00
c<01><00>y)Nr<4E>r<>rNs r2rfzNullPool.status+s<00><00>r3c<01>$<00>|j<00>yrn)r9r;s r2r=zNullPool._do_return_conn.s <00><00><0E> <0C> <0C>r3c<01>"<00>|j<00>Srn)rHrNs r2rCzNullPool._do_get1s<00><00><13>&<26>&<26>(<28>(r3c
2025-02-23 09:07:52 +08:00
<01>
<00>|jjd<01>|j|j|j|j
2025-08-29 00:34:40 +08:00
|j |j|j|j|j<00><02>S)NrQ)rSrTrUrVrRrWrX) rYrZr[r\r_rTr`rar^rbrcrNs r2rdzNullPool.recreate4sg<00><00> <0C> <0B> <0B><18><18>*<2A>+<2B><13>~<7E>~<7E> <10>M<EFBFBD>M<EFBFBD><18>M<EFBFBD>M<EFBFBD><15><19><19><1D>0<>0<> <20>1<>1<><19>^<5E>^<5E><1A>m<EFBFBD>m<EFBFBD><18>M<EFBFBD>M<EFBFBD><1E> 
2025-02-23 09:07:52 +08:00
<EFBFBD>
2025-08-29 00:34:40 +08:00
r3c<01><00>yrnr<>rNs r2rizNullPool.disposeB<00><00><00> r3Nrrzr})r{r<>r~) r<>r<>r<>r<>rfr=rCrdrir<>r3r2r<>r<>s <00><00> <08><1A><17>)<29> 
2025-02-23 09:07:52 +08:00
<EFBFBD> r3r<>c<01>b<00>eZdZdZdZ d d d<03>Zdd<04>Zdd<05>Zdd<06>Zdd<07>Z dd<08>Z
dd <09>Z dd
<EFBFBD>Z y )<14>SingletonThreadPoola'A Pool that maintains one connection per thread.
Maintains one connection per each thread, never moving a connection to a
thread other than the one which it was created in.
.. warning:: the :class:`.SingletonThreadPool` will call ``.close()``
on arbitrary connections that exist beyond the size setting of
``pool_size``, e.g. if more unique **thread identities**
than what ``pool_size`` states are used. This cleanup is
non-deterministic and not sensitive to whether or not the connections
linked to those thread identities are currently in use.
:class:`.SingletonThreadPool` may be improved in a future release,
however in its current status it is generally used only for test
scenarios using a SQLite ``:memory:`` database and is not recommended
for production use.
The :class:`.SingletonThreadPool` class **is not compatible** with asyncio
and :func:`_asyncio.create_async_engine`.
Options are the same as those of :class:`_pool.Pool`, as well as:
:param pool_size: The number of threads in which to maintain connections
at once. Defaults to five.
:class:`.SingletonThreadPool` is used by the SQLite dialect
automatically when a memory-based database is used.
See :ref:`sqlite_toplevel`.
Fc <01><><00>tj||fi|<03><01>tj<00>|_tj<00>|_t <00>|_||_yrn) rr%r)<00>local<61>_conn<6E>_fairy<72>set<65>
2025-08-29 00:34:40 +08:00
_all_connsrE)r,r-r.r1s r2r%zSingletonThreadPool.__init__isC<00><00> <0A> <0A> <0A>d<EFBFBD>G<EFBFBD>*<2A>r<EFBFBD>*<2A><1E>_<EFBFBD>_<EFBFBD>&<26><04>
2025-02-23 09:07:52 +08:00
<EFBFBD><1F>o<EFBFBD>o<EFBFBD>'<27><04> <0B>47<34>E<EFBFBD><04><0F><1D><04> r3c <01> <00>|jjd<01>|j|j|j|j
2025-08-29 00:34:40 +08:00
|j |j|j|j|j|j<00><02> S)NrQ)r.rSrTrRrUrVrWrX) rYrZr[r\rEr_rTr^r`rarbrcrNs r2rdzSingletonThreadPool.recreateusn<00><00> <0C> <0B> <0B><18><18>*<2A>+<2B><13>~<7E>~<7E> <10>M<EFBFBD>M<EFBFBD><1A>i<EFBFBD>i<EFBFBD><18>M<EFBFBD>M<EFBFBD><15><19><19><19>^<5E>^<5E><1D>0<>0<> <20>1<>1<><1A>m<EFBFBD>m<EFBFBD><18>M<EFBFBD>M<EFBFBD><1E>
2025-02-23 09:07:52 +08:00

<EFBFBD>
2025-08-29 00:34:40 +08:00
r3c<01><><00>|jD]} |j<00><00>|jj<00>y#t$rY<00><wxYw)zDispose of this pool.N)r<>r9<00> Exception<6F>clearrgs r2rizSingletonThreadPool.dispose<73>sH<00><00><19>O<EFBFBD>O<EFBFBD>D<EFBFBD> <15><14>
2025-02-23 09:07:52 +08:00
<EFBFBD>
<EFBFBD> <0C>$<24> <0A><0F><0F><1D><1D><1F><> <1D> <15><15> <15>s<00>><02> A
<05> A
2025-08-29 00:34:40 +08:00
c<01><><00>t|j<00>|jk\rN|jj<00>}|j <00>t|j<00>|jk\r<01>Myyrn)<05>lenr<6E>rE<00>popr9<00>r,<00>cs r2<00>_cleanupzSingletonThreadPool._cleanup<75>sI<00><00><11>$<24>/<2F>/<2F>"<22>d<EFBFBD>i<EFBFBD>i<EFBFBD>/<2F><14><0F><0F>#<23>#<23>%<25>A<EFBFBD> <0A>G<EFBFBD>G<EFBFBD>I<EFBFBD><12>$<24>/<2F>/<2F>"<22>d<EFBFBD>i<EFBFBD>i<EFBFBD>/r3c<01>H<00>dt|<00>t|j<00>fzS)Nz"SingletonThreadPool id:%d size: %d)<03>idr<64>r<>rNs r2rfzSingletonThreadPool.status<75>s'<00><00>3<> <0E>t<EFBFBD>H<EFBFBD> <0F><04><0F><0F> <20>7
2025-02-23 09:07:52 +08:00
<EFBFBD>
<EFBFBD>
2025-08-29 00:34:40 +08:00
r3c<01><<00> |j`y#t$rYywxYwrn)r<><00>current<6E>AttributeErrorr;s r2r=z#SingletonThreadPool._do_return_conn<6E>s#<00><00> <11><14> <0B> <0B>#<23><><1D> <11> <10> <11>s <00> <00> <03>c<01><><00> tr)tt|jj <00><00>}n|jj <00>}|r|S |j <00>}tj|<01>|j_t|j<00>|jk\r|j<00>|jj|<01>|S#t
2025-02-23 09:07:52 +08:00
$rY<00><>wxYwrn)r
2025-08-29 00:34:40 +08:00
rrr<>r<>r<>rH<00>weakref<65>refr<66>r<>rEr<><00>addr<64>s r2rCzSingletonThreadPool._do_get<65>s<><00><00> <11><1C><18>,<2C>d<EFBFBD>j<EFBFBD>j<EFBFBD>.@<40>.@<40>.B<>C<><01><18>J<EFBFBD>J<EFBFBD>&<26>&<26>(<28><01><10><18><08><11> <11> #<23> #<23> %<25><01>$<24>[<5B>[<5B><11>^<5E><04>
2025-02-23 09:07:52 +08:00
<EFBFBD>
<EFBFBD><1A> <0E>t<EFBFBD><EFBFBD><EFBFBD> <1F>4<EFBFBD>9<EFBFBD>9<EFBFBD> ,<2C> <10>M<EFBFBD>M<EFBFBD>O<EFBFBD> <0C><0F><0F><1B><1B>A<EFBFBD><1E><10><08><><1E> <11> <10> <11>s<00>A C<00> C<03>Cc<01><><00> tt|jj<00><00>}|<01>|j <00>Stj ||j<00>S#t
2025-08-29 00:34:40 +08:00
$rY<00>+wxYwrn)rrr<>r<><00>_checkout_existingr<67><00> _checkout<75>r,<00>recs r2<00>connectzSingletonThreadPool.connect<63>sb<00><00> 0<><16>'<27><14><1B><1B>)<<3C>)<<3C>)><3E>?<3F>C<EFBFBD><13><EFBFBD><1A>-<2D>-<2D>/<2F>/<2F><1F>)<29>)<29>$<24><04> <0B> <0B><<3C><<3C><> <1E> <11> <10> <11>s<00>(A<00> A(<03>'A(N)rt)r-rvr.rwr1r)r{r<>r~rrzr})r{r) r<>r<>r<>r<>r<>r%rdrir<>rfr=rCr<>r<>r3r2r<>r<>FsX<00><00><08>@<18>K<EFBFBD>
2025-02-23 09:07:52 +08:00
<1B>
<1E>:<3A>
<1E><17>
<1E><12>
<1E> 
<EFBFBD>  <20><16>

<EFBFBD> <11> <11>" =r3r<>c<01>n<00>eZdZdZej
d d<02><04>Zd d<03>Zd d<04>Zdd<05>Z dd<06>Z
dd<07>Z dd<08>Z dd <09>Z y
)<12>
StaticPoola~A Pool of exactly one connection, used for all requests.
Reconnect-related functions such as ``recycle`` and connection
invalidation (which is also used to support auto-reconnect) are only
partially supported right now and may not yield good results.
The :class:`.StaticPool` class **is compatible** with asyncio and
:func:`_asyncio.create_async_engine`.
c<01><00>t|<00>SrnrrNs r2<00>
2025-08-29 00:34:40 +08:00
connectionzStaticPool.connection<6F>s <00><00> <20><14>&<26>&r3c<01><00>y)Nr<4E>r<>rNs r2rfzStaticPool.status<75>s<00><00>r3c<01><><00>d|jvr?|jj<00>(|jj<00>|jd=yyy<00>Nr<4E>)<04>__dict__r<5F><00>dbapi_connectionr9rNs r2rizStaticPool.dispose<73>sD<00><00> <18>D<EFBFBD>M<EFBFBD>M<EFBFBD> )<29><14><0F><0F>0<>0<><<3C> <10>O<EFBFBD>O<EFBFBD> !<21> !<21> #<23><14> <0A> <0A>l<EFBFBD>+<2B>=<3D> *r3c
2025-02-23 09:07:52 +08:00
<01>
<00>|jjd<01>|j|j|j|j
2025-08-29 00:34:40 +08:00
|j |j|j|j|j<00><02>S)NrQ)r-rSrVrRrTrUrWrX) rYrZr[r\r_rar^rTr`rbrcrNs r2rdzStaticPool.recreate<74>sg<00><00> <0C> <0B> <0B><18><18>*<2A>+<2B><13>~<7E>~<7E><18>M<EFBFBD>M<EFBFBD><18>M<EFBFBD>M<EFBFBD> <20>1<>1<><19>^<5E>^<5E><15><19><19><1D>0<>0<><1A>m<EFBFBD>m<EFBFBD><18>M<EFBFBD>M<EFBFBD><1E> 
2025-02-23 09:07:52 +08:00
<EFBFBD>
2025-08-29 00:34:40 +08:00
r3c<01> <00><01>d<02>fd<01> }||_y)Nc<01><<00><01><00>jj}|<01>J<00>|Srn)r<>r<>)r<>rh<00>other_static_pools <20>r2r-z*StaticPool._transfer_from.<locals>.creator<6F>s%<00><><00>$<24>/<2F>/<2F>@<40>@<40>D<EFBFBD><17>#<23> #<23>#<23><17>Kr3)r<>rr{r)<01>_invoke_creator)r,r<>r-s ` r2<00>_transfer_fromzStaticPool._transfer_from<6F>s<00><><00> <18>
'<27><04>r3c<01><00>t<00><00>rn)<01>NotImplementedErrorrNs r2rHzStaticPool._create_connection<6F>s <00><00>!<21>#<23>#r3c<01><00>yrnr<>r;s r2r=zStaticPool._do_return_conn<6E>r<>r3c<01>p<00>|j}|j<00>r|jd=|j}|Sr<>)r<><00>_is_hard_or_soft_invalidatedr<64>r<>s r2rCzStaticPool._do_get<65>s1<00><00><12>o<EFBFBD>o<EFBFBD><03> <0E> +<2B> +<2B> -<2D><14> <0A> <0A>l<EFBFBD>+<2B><16>/<2F>/<2F>C<EFBFBD><12>
r3N)r{rrr~)r{r<>)r<>r<>r{r|r}rz)r<>r<>r<>r<>r<00>memoized_propertyr<79>rfrirdr<>rHr=rCr<>r3r2r<>r<><00>sD<00><00> <08>
2025-02-23 09:07:52 +08:00
<EFBFBD><1B><1B>'<27><1C>'<27><1C>,<2C> 
<EFBFBD>'<27>$<24> <0A>r3r<>c<01>V<00>eZdZUdZded<ded<d d<06>Zdd<07>Zdd<08>Zdd <09>Zdd
<EFBFBD>Z dd <0B>Z
y )<13> AssertionPoola}A :class:`_pool.Pool` that allows at most one checked out connection at
any given time.
This will raise an exception if more than one connection is checked out
at a time. Useful for debugging code that is using more connections
than desired.
The :class:`.AssertionPool` class **is compatible** with asyncio and
:func:`_asyncio.create_async_engine`.
2025-08-29 00:34:40 +08:00
zOptional[ConnectionPoolEntry]r<>zOptional[List[str]]<5D>_checkout_tracebackc<01><><00>d|_d|_|jdd<03>|_d|_t j |g|<01><01>i|<02><01>y)NF<4E>store_tracebackT)r<><00> _checked_outr<74><00>_store_tracebackr<6B>rr%)r,<00>argsr1s r2r%zAssertionPool.__init__sC<00><00><19><04>
<EFBFBD>!<21><04><19> "<22><06><06>'8<>$<24> ?<3F><04><1D>#'<27><04> <20> <0C> <0A> <0A>d<EFBFBD>(<28>T<EFBFBD>(<28>R<EFBFBD>(r3c<01><00>y)Nr<4E>r<>rNs r2rfzAssertionPool.statuss<00><00>r3c<01>`<00>|js td<01><00>d|_||jusJ<00>y)Nzconnection is not checked outF)r<><00>AssertionErrorr<72>r;s r2r=zAssertionPool._do_return_conns1<00><00><13> <20> <20> <20>!@<40>A<> A<>!<21><04><19><15><14><1A><1A>#<23>#<23>#r3c<01>`<00>d|_|jr|jj<00>yyr5)r<>r<>r9rNs r2rizAssertionPool.dispose!s&<00><00>!<21><04><19> <0F>:<3A>:<3A> <10>J<EFBFBD>J<EFBFBD> <1C> <1C> <1E> r3c
2025-02-23 09:07:52 +08:00
<01>
<00>|jjd<01>|j|j|j|j
2025-08-29 00:34:40 +08:00
|j |j|j|j|j<00><02>S)NrQ)rTrRrSrVrUrWrX) rYrZr[r\rTr^r_rar`rbrcrNs r2rdzAssertionPool.recreate&sg<00><00> <0C> <0B> <0B><18><18>*<2A>+<2B><13>~<7E>~<7E> <10>M<EFBFBD>M<EFBFBD><15><19><19><19>^<5E>^<5E><18>M<EFBFBD>M<EFBFBD> <20>1<>1<><1D>0<>0<><1A>m<EFBFBD>m<EFBFBD><18>M<EFBFBD>M<EFBFBD><1E> 
2025-02-23 09:07:52 +08:00
<EFBFBD>
r3c<01>T<00>|jrD|jr(ddjt|j<00><00>z}nd}t d|z<00><00>|j
s|j <00>|_d|_|jrtj<00>|_|j
S)Nz at:
%s<>z!connection is already checked outT)
2025-08-29 00:34:40 +08:00
r<EFBFBD>r<><00>joinrr<>r<>rHr<><00> traceback<63> format_stack)r,<00>suffixs r2rCzAssertionPool._do_get3s<><00><00> <0F> <1C> <1C><13>'<27>'<27>#<23>b<EFBFBD>g<EFBFBD>g<EFBFBD>"<22>4<EFBFBD>#;<3B>#;<3B><<3C>'<12><12><06><1C><06> <20>!D<>v<EFBFBD>!M<>N<> N<><13>z<EFBFBD>z<EFBFBD><1D>0<>0<>2<>D<EFBFBD>J<EFBFBD> <20><04><19> <0F> <20> <20>'0<>'=<3D>'=<3D>'?<3F>D<EFBFBD> $<24><13>z<EFBFBD>z<EFBFBD>r3N)r<>rr1rrrzr~)r{r<>r}) r<>r<>r<>r<>r<>r%rfr=rirdrCr<>r3r2r<>r<>s3<00><00>
2025-02-23 09:07:52 +08:00
<08> )<29>(<28>,<2C>,<2C>)<29><1F>$<24> <1F>

<EFBFBD>r3r<>))r<><00>
__future__rr)r<><00>typingrrrrrr r
2025-08-29 00:34:40 +08:00
r r<><00>baser rrrrrrrr<>rrrrr7<00> util.typingr<00>engine.interfacesrrr<>r<>r<>r<>r<>r<>r<>r3r2<00><module>r<>s<><00><01>#<23>"<22><10><10> <0A><16><17><17><1B><16><17> <20><18><0E>#<23>"<22>#<23> <20>$<24>%<25><16>'<27><12><13>!<21>&<26>!<21> <09><17><17>3<>UH<01><04>UH<01>p#<23>I<EFBFBD>#<23>*8<>$9<>8<>' <0A>t<EFBFBD>' <0A>Tw=<3D>$<24>w=<3D>t><13><14>><13>BB<1A>D<EFBFBD>Br3