Files
952-11/env/python/dll/Python312/Lib/__pycache__/queue.cpython-312.pyc
T

129 lines
14 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åf..ãó—dZddlZddlZddlmZddlmZmZddlm Z ddl
m Z gd¢Z
ddl
mZGd „d e«ZGd
„d«ZGd„de«ZGd„de«ZGd„d«Ze €eZ yy#e $rdZ YŒOwxYw#e $rGd „d
e«ZYŒZwxYw)z'A multi-producer, multi-consumer queue.éN)Údeque)ÚheappushÚheappop)Ú monotonic)Ú SimpleQueue)ÚEmptyÚFullÚQueueÚ
PriorityQueueÚ LifoQueuer)rcó—eZdZdZy)rz4Exception raised by Queue.get(block=0)/get_nowait().N©Ú__name__Ú
__module__Ú __qualname__Ú__doc__©óúAC:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\queue.pyrrs„Ù>Ø rrcó—eZdZdZy)r z4Exception raised by Queue.put(block=0)/put_nowait().Nrrrrr r s„Ù:Ørr cóŽ—eZdZdZdd„Zd„Zd„Zd„Zd„Zd„Z dd „Z
dd
„Z d „Z d „Z
d
„Zd„Zd„Zd„Zeej(«Zy)r
zjCreate a queue object with a given maximum size.
If maxsize is <= 0, the queue size is infinite.
cóL—||_|j|«tj«|_tj
|j«|_tj
|j«|_tj
|j«|_d|_ y©Nr)
ÚmaxsizeÚ_initÚ threadingÚLockÚmutexÚ ConditionÚ not_emptyÚnot_fullÚall_tasks_doneÚunfinished_tasks©Úselfrs rÚ__init__zQueue.__init__"sv€ØˆŒ Ø �
‰
�7Ôô —^‘^Ó%ˆŒ
ô#×,Ñ,¨T¯Z©ZÓ8ˆŒô"×+Ñ+¨D¯J©JÓ7ˆŒ
ô(×1Ñ1°$·*±*Ó=ˆÔØ !ˆÕrcóЗ|j5|jdz
}|dkr*|dkr td«‚|jj«||_ddd«y#1swYyxYw)a.Indicate that a formerly enqueued task is complete.
Used by Queue consumer threads. 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 a ValueError if called more times than there were items
placed in the queue.
érz!task_done() called too many timesN)r"r#Ú
ValueErrorÚ
notify_all)r%Ú
unfinisheds rÚ task_donezQueue.task_done9sf€ð×
Ñ
ñ /Ø×.Ñ.°Ñ2ˆJؘQŠØ ’>Ü$Ð%HÓIÐIØ×#Ñ#×.Ñ.Ô0Ø$.ˆDÔ !÷
 /÷ /ñ /ús �AAÁA%có¬—|j5|jr'|jj«|jrŒ'ddd«y#1swYyxYw)aƒBlocks 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 thread calls task_done()
to indicate the item was retrieved and all work on it is complete.
When the count of unfinished tasks drops to zero, join() unblocks.
N)r"r#Úwait©r%s rÚjoinz
Queue.joinOsH€ð×
Ñ
ñ +Ø×'Ò'Ø×#Ñ#×(Ñ(Ô*ð×'Ó'÷ +÷ +ñ +ús �3A
Á
Acóf—|j5|j«cddd«S#1swYyxYw)ú9Return the approximate size of the queue (not reliable!).N©rÚ_qsizer/s rÚqsizez Queue.qsize\s'€à
�Z‰Zñ !Ø—;‘;“=÷ !÷ !ò !ús�'§0cóh—|j5|j« cddd«S#1swYyxYw)aÝReturn True if the queue is empty, False otherwise (not reliable!).
This method is likely to be removed at some point. Use qsize() == 0
as a direct substitute, but be aware that either approach risks a race
condition where a queue can grow before the result of empty() or
qsize() can be used.
To create code that needs to wait for all queued tasks to be
completed, the preferred technique is to use the join() method.
Nr3r/s rÚemptyz Queue.emptyas,€ð�Z‰Zñ %Ø—{‘{“}Ð$÷ %÷ %ò %ús�(¨1có–—|j5d|jcxkxr|j«knccddd«S#1swYyxYw)aOReturn True if the queue is full, False otherwise (not reliable!).
This method is likely to be removed at some point. Use qsize() >= n
as a direct substitute, but be aware that either approach risks a race
condition where a queue can shrink before the result of full() or
qsize() can be used.
rN)rrr4r/s rÚfullz
Queue.fullos7€ð�Z‰Zñ 5Ø�t—|‘|Ö4 t§{¡{£}Ô4÷ 5÷ 5ò 5ús �(?¿ANcóö—|j5|jdkD�r|s#|j«|jk\rét‚|€V|j«|jk\rÄ|jj «|j«|jk\rŒ8n‹|dkr t d«‚t
«|z}|j«|jk\rQ|t
«z
}|dkrt‚|jj |«|j«|jk\rŒQ|j|«|xjdz
c_|jj«ddd«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 non-negative 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).
rNú''timeout' must be a non-negative numberçr() r!rr4r r.r)ÚtimeÚ_putr#r Únotify)r%ÚitemÚblockÚtimeoutÚendtimeÚ remainings rÚputz Queue.putzs€ð�]‰]ñ $Ø�|‰|˜aÓÙØ—{‘{“}¨¯ © Ò4Ü"˜
Ø�_ØŸ+™+›-¨4¯<©<Ò7ØŸ
™
×*Ñ*Ô,ðŸ+™+›-¨4¯<©<Ô7à˜q’[Ü$Ð%NÓOÐOä"›f wÑ.�GØŸ+™+›-¨4¯<©<Ò7Ø$+¬d«fÑ$4˜ Ø$¨Ò+Ü"&˜JØŸ
™
×*Ñ*¨9Ô5ð Ÿ+™+›-¨4¯<©<Ó7ð
�I‰I�dŒOØ × !Ò ! QÑ &Õ !Ø �N‰N× !Ñ !Ô #÷' $÷ $ñ $ús�B E/ÂB E/Ä&AE/Å/E8có,—|j5|s|j«sµt‚|€<|j«s�|jj«|j«sŒ+nq|dkr t d«‚t «|z}|j«sD|t «z
}|dkrt‚|jj|«|j«sŒD|j
«}|jj«|cddd«S#1swYyxYw)á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 non-negative 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;r<) r r4rr.r)r=Ú_getr!r?)r%rArBrCrDr@s rÚgetz Queue.getšsØ€ð�^‰^ñ ÙØ—{‘{”}Ü�KØ�ØŸ+™+œ-Ø—N‘N×'Ñ'Ô)ðŸ+™+ž-à˜1’Ü Ð!JÓKÐKä›& 7Ñ*�ØŸ+™+œ-Ø '¬$«&Ñ 0�IØ  CÒ'Ü#˜ Ø—N‘N×'Ñ'¨ Ô2ð Ÿ+™+�-ð
—9‘9“;ˆDØ �M‰M× Ñ Ô "Ø÷% ÷ ò ús�AD
Á#A1D
Ã+D
Ä
Dcó(—|j|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©rA©rE©r%r@s rÚ
put_nowaitzQueue.put_nowait¹ó€ð �x‰x˜ EˆxÓ*Ð*rcó&—|jd¬«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.
FrK©rIr/s rÚ
get_nowaitzQueue.get_nowaitÁó€ð �x‰x˜eˆxÓ$Ð$rcó"—t«|_y©N)rÚqueuer$s rrz Queue._initÎs €Ü“Wˆ�
rcó,—t|j«SrV©ÚlenrWr/s rr4z Queue._qsizeÑó€Ü�4—:‘:‹Ðrcó:—|jj|«yrV©rWÚappendrMs rr>z
Queue._putÕó€Ø �
‰
×ј$Õrcó6—|jj«SrV)rWÚpopleftr/s rrHz
Queue._getÙs€Ø�z‰z×!Ñ!Ó#Ð#r)r©TN)rrrrr&r,r0r5r7r9rErIrNrSrr4r>rHÚ classmethodÚtypesÚ GenericAliasÚ__class_getitem__rrrr
r
sa„ñó
"ò./ò, +ò!ò
%ò 5ó$ó@ò>+ò%òòò ò$ñ$ E×$6Ñ$6Ó7Ñrr
có(—eZdZdZd„Zd„Zd„Zd„Zy)r zœVariant of Queue that retrieves open entries in priority order (lowest first).