Files
aitsc/.venv/Lib/site-packages/sqlalchemy/util/__pycache__/queue.cpython-312.pyc

91 lines
14 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>h )<00><01>h<00>dZddlmZddlZddlmZddlZddlmZddl Z ddl m
2025-02-23 09:07:52 +08:00
Z
ddl m Z ddl m Z dd l m Z dd
l mZdd l mZd d lmZd dlmZd dlmZede
<EFBFBD><11>Zgd<12>ZGd<13>de<17>ZGd<15>de<17>ZGd<17>de e<00>ZGd<19>dee<00>ZGd<1B>dee<00>ZGd<1D>dee<00>Zy)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.
<EFBFBD>)<01> annotationsN)<01>deque)<01>time)<01>Any)<01> Awaitable)<01>Deque)<01>Generic)<01>Optional)<01>TypeVar<61>)<01>await_fallback)<01>
await_only)<01>memoized_property<74>_T)<01>bound)<03>Empty<74>Full<6C>Queuec<01><00>eZdZdZy)rz4Exception raised by Queue.get(block=0)/get_nowait().N<><04>__name__<5F>
2025-08-29 00:34:40 +08:00
__module__<EFBFBD> __qualname__<5F>__doc__<5F><00><00>BD:\pythonpj\aitsc\.venv\Lib\site-packages\sqlalchemy/util/queue.pyrr,<00><00><00>:<3A>rrc<01><00>eZdZdZy)rz4Exception raised by Queue.put(block=0)/put_nowait().Nrrrrrr2rrrc<01>x<00>eZdZUded<ded<ddd<05>Zdd<06>Zdd<07>Zdd<08>Zdd <09>Z d dd <0B>Z dd <0C>Z
2025-02-23 09:07:52 +08:00
ddd <0A>Z y
)<17> QueueCommon<6F>int<6E>maxsize<7A>bool<6F>use_lifoc<01><00>y<00>Nr<00><03>selfr#r%s r<00>__init__zQueueCommon.__init__<s<00><00>#rc<01><00>t<00><00>r'<00><01>NotImplementedError<6F>r)s r<00>emptyzQueueCommon.empty><00> <00><00>!<21>#<23>#rc<01><00>t<00><00>r'r,r.s r<00>fullzQueueCommon.fullAr0rc<01><00>t<00><00>r'r,r.s r<00>qsizezQueueCommon.qsizeDr0rc<01><00>t<00><00>r'r,<00>r)<00>items r<00>
put_nowaitzQueueCommon.put_nowaitGr0rNc<01><00>t<00><00>r'r,)r)r7<00>block<63>timeouts r<00>putzQueueCommon.putJs <00><00>"<22>#<23>#rc<01><00>t<00><00>r'r,r.s r<00>
get_nowaitzQueueCommon.get_nowaitOr0rc<01><00>t<00><00>r'r,)r)r:r;s r<00>getzQueueCommon.getRr0r<00>rF<>r#r"r%r$<00><02>returnr$<00>rDr"<00>r7rrD<00>None<6E>TN<54>r7rr:r$r;<00>Optional[float]rDrG<00>rDr<00>r:r$r;rJrDr) rrr<00>__annotations__r*r/r2r4r8r<r>r@rrrr!r!8sY<00><00> <10>L<EFBFBD><12>N<EFBFBD>E<>$<24>$<24>$<24>$<24>HL<01>$<24><16>$<24>#<23>$<24>5D<35>$<24> <0A>$<24>
$<24>$rr!c<01><><00>eZdZUded<ddd<03>Zdd<04>Zdd<05>Zdd<06>Z d dd<08>Zdd <09>Z ddd
<EFBFBD>Z
dd <0B>Z dd <0C>Z dd <0A>Z dd<0E>Zdd<0F>Zdd<10>Zdd<11>Zy)rz Deque[_T]<5D>queuec<01><><00>|j|<01>tj<00>|_tj|j<00>|_tj|j<00>|_||_y)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)<08>_init<69> threading<6E>RLock<63>mutex<65> Condition<6F> not_empty<74>not_fullr%r(s rr*zQueue.__init__YsW<00><00> <0A>
<EFBFBD>
<EFBFBD>7<EFBFBD><1B>
<1F>_<EFBFBD>_<EFBFBD>&<26><04>
<EFBFBD>#<23>,<2C>,<2C>T<EFBFBD>Z<EFBFBD>Z<EFBFBD>8<><04><0E>"<22>+<2B>+<2B>D<EFBFBD>J<EFBFBD>J<EFBFBD>7<><04> <0A> <20><04> rc<01>f<00>|j5|j<00>cddd<01>S#1swYyxYw)z9Return the approximate size of the queue (not reliable!).N)rT<00>_qsizer.s rr4z Queue.qsizeps<00><00><12>Z<EFBFBD>Z<EFBFBD><17>;<3B>;<3B>=<3D><18>Z<EFBFBD>Z<EFBFBD><5A><00>'<03>0c<01>f<00>|j5|j<00>cddd<01>S#1swYyxYw)zKReturn True if the queue is empty, False otherwise (not
reliable!).N)rT<00>_emptyr.s rr/z Queue.emptyvs<00><00><12>Z<EFBFBD>Z<EFBFBD><17>;<3B>;<3B>=<3D><18>Z<EFBFBD>Z<EFBFBD>rZc<01>f<00>|j5|j<00>cddd<01>S#1swYyxYw)zJReturn True if the queue is full, False otherwise (not
reliable!).N)rT<00>_fullr.s rr2z
Queue.full}s<00><00><12>Z<EFBFBD>Z<EFBFBD><17>:<3A>:<3A><<3C><18>Z<EFBFBD>Z<EFBFBD>rZNc<01>*<00>|j5|s|j<00>r<>t<00>|<03><|j<00>r<>|jj<00>|j<00>r<01>+nq|dkr t d<03><00>t <00>|z}|j<00>rD|t <00>z
}|dkrt<00>|jj|<05>|j<00>r<01>D|j |<01>|jj<00>ddd<01>y#1swYyxYw)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).
Nr<00>#'timeout' must be a positive number<65>) rWr^r<00>wait<69>
ValueError<EFBFBD>_time<6D>_putrV<00>notify)r)r7r:r;<00>endtime<6D> remainings rr<z Queue.put<75>s<><00><00><12>]<5D>]<5D><18><17>:<3A>:<3A><<3C><1E>J<EFBFBD><18><1F><1A>j<EFBFBD>j<EFBFBD>l<EFBFBD><18>M<EFBFBD>M<EFBFBD>&<26>&<26>(<28><1B>j<EFBFBD>j<EFBFBD>l<EFBFBD><1B>Q<EFBFBD>;<3B>$<24>%J<>K<>K<><1F>'<27>G<EFBFBD>+<2B><07><1A>j<EFBFBD>j<EFBFBD>l<EFBFBD> '<27>%<25>'<27> 1<>I<EFBFBD> <20>C<EFBFBD>'<27>"<22>
<EFBFBD><18>M<EFBFBD>M<EFBFBD>&<26>&<26>y<EFBFBD>1<> <1B>j<EFBFBD>j<EFBFBD>l<EFBFBD>
<11>I<EFBFBD>I<EFBFBD>d<EFBFBD>O<EFBFBD> <10>N<EFBFBD>N<EFBFBD> !<21> !<21> #<23>#<1B>]<5D>]<5D>s<00>AD <03>#A1D <03>+D <03> Dc<01>&<00>|j|d<01>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<r6s rr8zQueue.put_nowait<69>s<00><00> <14>x<EFBFBD>x<EFBFBD><04>e<EFBFBD>$<24>$rc<01>,<00>|j5|s|j<00>r<>t<00>|<02><|j<00>r<>|jj<00>|j<00>r<01>+nq|dkr t d<03><00>t <00>|z}|j<00>rD|t <00>z
}|dkrt<00>|jj|<04>|j<00>r<01>D|j <00>}|jj<00>|cddd<01>S#1swYyxYw)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).
Nrr`ra) rVr\rrbrcrd<00>_getrWrf)r)r:r;rgrhr7s rr@z Queue.get<65>s<><00><00><12>^<5E>^<5E><18><17>;<3B>;<3B>=<3D><1F>K<EFBFBD><18><1F><1A>k<EFBFBD>k<EFBFBD>m<EFBFBD><18>N<EFBFBD>N<EFBFBD>'<27>'<27>)<29><1B>k<EFBFBD>k<EFBFBD>m<EFBFBD><1B>Q<EFBFBD>;<3B>$<24>%J<>K<>K<><1F>'<27>G<EFBFBD>+<2B><07><1A>k<EFBFBD>k<EFBFBD>m<EFBFBD> '<27>%<25>'<27> 1<>I<EFBFBD> <20>C<EFBFBD>'<27>#<23> <0B><18>N<EFBFBD>N<EFBFBD>'<27>'<27> <09>2<> <1B>k<EFBFBD>k<EFBFBD>m<EFBFBD>
<18>9<EFBFBD>9<EFBFBD>;<3B>D<EFBFBD> <10>M<EFBFBD>M<EFBFBD> <20> <20> "<22><17>%<1C>^<5E>^<5E>s<00>AD
<03>#A1D
<03>+D
<03>
Dc<01>$<00>|jd<01>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@r.s rr>zQueue.get_nowait<69>s<00><00><14>x<EFBFBD>x<EFBFBD><05><EFBFBD>rc<01>0<00>||_t<00>|_yr')r#rrO)r)r#s rrQz Queue._init<69>s<00><00><1E><04> <0C><1A>W<EFBFBD><04>
rc<01>,<00>t|j<00>Sr')<02>lenrOr.s rrYz Queue._qsize<7A>s<00><00><12>4<EFBFBD>:<3A>:<3A><EFBFBD>rc<01><00>|j Sr')rOr.s rr\z Queue._empty<74>s<00><00><17>:<3A>:<3A>~<7E>rc<01>h<00>|jdkDxr"t|j<00>|jk(S)Nr)r#rorOr.s rr^z Queue._full<6C>s'<00><00><13>|<7C>|<7C>a<EFBFBD><1F>C<>C<EFBFBD><04>
<EFBFBD>
<EFBFBD>O<EFBFBD>t<EFBFBD>|<7C>|<7C>$C<>Crc<01>:<00>|jj|<01>yr')rO<00>appendr6s rrez
Queue._put<75>s<00><00> <0C>
<EFBFBD>
<EFBFBD><19><19>$<24>rc<01><><00>|jr|jj<00>S|jj<00>Sr')r%rO<00>pop<6F>popleftr.s rrkz
Queue._get<65>s/<00><00> <0F>=<3D>=<3D><17>:<3A>:<3A>><3E>><3E>#<23> #<23><18>:<3A>:<3A>%<25>%<25>'<27> 'rrArBrErCrHrIrFrLrK)r#r"rDrG)rrrrMr*r4r/r2r<r8r@r>rQrYr\r^rerkrrrrrVsx<00><00> <14><14>!<21>.!<21> !<21> <20>HL<01> $<24><16> $<24>#<23> $<24>5D<35> $<24> <0A> $<24>D%<25><18>@<1F><1D><1F><1E>D<01> <20>(rrc<01><><00>eZdZejr
ed d<01><04>Znee<07>Zd dd<02>Zdd<03>Z d<04>Z
d<05>Z e dd<06><04>Z dd<07>Z d dd <09>Zdd
<EFBFBD>Zddd <0B>Zy)<16>AsyncAdaptedQueuec<01><00>yr'r)<01> coroutines r<00>await_zAsyncAdaptedQueue.await_<74>s<00><00>58rc<01> <00>||_||_yr')r%r#r(s rr*zAsyncAdaptedQueue.__init__<5F>s<00><00> <20><04> <0A><1E><04> rc<01>6<00>|jj<00>Sr')<02>_queuer/r.s rr/zAsyncAdaptedQueue.empty<74><00><00><00><13>{<7B>{<7B> <20> <20>"<22>"rc<01>6<00>|jj<00>Sr')r~r2r.s rr2zAsyncAdaptedQueue.fulls<00><00><13>{<7B>{<7B><1F><1F>!<21>!rc<01>6<00>|jj<00>Sr')r~r4r.s rr4zAsyncAdaptedQueue.qsizerrc<01><><00>|jr"tj|j<00><01>}|Stj|j<00><01>}|S)N)r#)r%<00>asyncio<69> LifoQueuer#r)r)rOs rr~zAsyncAdaptedQueue._queues?<00><00> <10>=<3D>=<3D><1B>%<25>%<25>d<EFBFBD>l<EFBFBD>l<EFBFBD>;<3B>E<EFBFBD><15> <0C><1C>M<EFBFBD>M<EFBFBD>$<24>,<2C>,<2C>7<>E<EFBFBD><14> rc<01><><00> |jj|<01>y#tj$r}t <00>|<02>d}~wwxYwr')r~r8r<><00> QueueFullr)r)r7<00>errs rr8zAsyncAdaptedQueue.put_nowaits9<00><00> "<22> <10>K<EFBFBD>K<EFBFBD> "<22> "<22>4<EFBFBD> (<28><><16> <20> <20> "<22><16>&<26>c<EFBFBD> !<21><> "<22>s<00><00>A<03> <<03>ANc<01>n<00>|s|j|<01>S |<03>?|jtj|jj |<01>|<03><00>y|j|jj |<01><00>y#tj tjf$r}t<00>|<04>d}~wwxYwr') r8r{r<><00>wait_forr~r<r<><00> TimeoutErrorr)r)r7r:r;r<>s rr<zAsyncAdaptedQueue.puts<><00><00><15><17>?<3F>?<3F>4<EFBFBD>(<28> (<28> "<22><16>"<22><14> <0B> <0B>G<EFBFBD>,<2C>,<2C>T<EFBFBD>[<5B>[<5B>_<EFBFBD>_<EFBFBD>T<EFBFBD>-B<>G<EFBFBD>L<>M<><14> <0B> <0B>D<EFBFBD>K<EFBFBD>K<EFBFBD>O<EFBFBD>O<EFBFBD>D<EFBFBD>1<>2<><32><17>!<21>!<21>7<EFBFBD>#7<>#7<>8<> "<22><16>&<26>c<EFBFBD> !<21><> "<22>s<00>AB<00>*B<00>#B4<03>$ B/<03>/B4c<01><><00> |jj<00>S#tj$r}t <00>|<01>d}~wwxYwr')r~r>r<><00>
QueueEmptyr)r)r<>s rr>zAsyncAdaptedQueue.get_nowait+s:<00><00> #<23><17>;<3B>;<3B>)<29>)<29>+<2B> +<2B><><16>!<21>!<21> #<23><17>'<27>s<EFBFBD> "<22><> #<23>s<00><00>?<03> :<03>?c<01>d<00>|s|j<00>S |<02>=|jtj|jj <00>|<02><00>S|j|jj <00><00>S#tj tjf$r}t<00>|<03>d}~wwxYwr') r>r{r<>r<>r~r@r<>r<>r)r)r:r;r<>s rr@zAsyncAdaptedQueue.get1s<><00><00><14><17>?<3F>?<3F>$<24> $<24> #<23><16>"<22><1B>{<7B>{<7B><1B>$<24>$<24>T<EFBFBD>[<5B>[<5B>_<EFBFBD>_<EFBFBD>%6<><07>@<40><12><12><1C>{<7B>{<7B>4<EFBFBD>;<3B>;<3B>?<3F>?<3F>#4<>5<>5<><35><17>"<22>"<22>G<EFBFBD>$8<>$8<>9<> #<23><17>'<27>s<EFBFBD> "<22><> #<23>s<00>>A<<00>(A<<00><#B/<03> B*<03>*B/)rzzAwaitable[Any]rDrrArBrC)rDzasyncio.Queue[_T]rFrHrIrKrL)rrr<00>typing<6E> TYPE_CHECKING<4E> staticmethodr{rr*r/r2r4rr~r8r<r>r@rrrrxrx<00>s<><00><00> <0A><1B><1B> <15>8<>
<16>8<><1E>j<EFBFBD>)<29><06><1F>#<23>"<22>#<23><17><15><17><15> "<22>HL<01> "<22><16> "<22>#<23> "<22>5D<35> "<22> <0A> "<22>#<23> #rrxc<01>6<00>eZdZejs ee<06>Zyy)<02>FallbackAsyncAdaptedQueueN)rrrr<>r<>r<>r r{rrrr<>r<>@s<00><00> <11> <1F> <1F><1D>n<EFBFBD>-<2D><06> rr<>)r<00>
__future__rr<><00> collectionsrrRrrdr<>rrrr r
r <00> concurrencyr r<00> langhelpersrr<00>__all__<5F> Exceptionrrr!rrxr<>rrr<00><module>r<>s<><00><01> <04>#<23><0E><1D><10><1E> <0A><16><1C><18><1A><1B><1A>'<27>#<23>*<2A> <0A>T<EFBFBD><13><1D><02>
$<24><07> <09>I<EFBFBD> <09>  <09>9<EFBFBD> <09> $<24>'<27>"<22>+<2B>$<24><W(<28>K<EFBFBD><02>O<EFBFBD>W(<28>tM#<23> <0B>B<EFBFBD><0F>M#<23>`.<2E> 1<>"<22> 5<>.r