Ë ‚Ö¦iè, ã ó — d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl mZ g d¢Z ddl mZ G d„ de« Z G d „ d« Z G d„ de« Z G d„ de« Z G d„ d« Ze€eZyy# e$ r dZY ŒOw xY w# e$ r G d „ d e« ZY ŒZw xY w)z'A multi-producer, multi-consumer queue.é N)Údeque)ÚheappushÚheappop)Ú monotonic)ÚSimpleQueue)ÚEmptyÚFullÚQueueÚ PriorityQueueÚ LifoQueuer )r c ó — e Zd ZdZy)r z4Exception raised by Queue.get(block=0)/get_nowait().N©Ú__name__Ú __module__Ú__qualname__Ú__doc__© ó ú/usr/lib64/python3.12/queue.pyr r s „ Ù>Ør r c ó — e Zd ZdZy)r z4Exception raised by Queue.put(block=0)/put_nowait().Nr r r r r r s „ Ù:Ør r c óŽ — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zd„ Z dd „Z dd „Zd„ Zd„ Z d „ Zd„ Zd„ Zd„ Z eej( « Zy)r zjCreate a queue object with a given maximum size. If maxsize is <= 0, the queue size is infinite. c óL — || _ | j |« t j « | _ t j | j « | _ t j | j « | _ t j | j « | _ d| _ y ©Nr ) ÚmaxsizeÚ_initÚ threadingÚLockÚmutexÚ ConditionÚ not_emptyÚnot_fullÚall_tasks_doneÚunfinished_tasks©Úselfr s r Ú__init__zQueue.__init__" sv € ؈ŒØ� ‰ �7Ôô —^‘^Ó%ˆŒ ô #×,Ñ,¨T¯Z©ZÓ8ˆŒô "×+Ñ+¨D¯J©JÓ7ˆŒ ô (×1Ñ1°$·*±*Ó=ˆÔØ !ˆÕr c óÐ — | j 5 | j dz }|dk r*|dk rt d« ‚| j j « || _ ddd« y# 1 sw Y yxY w)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. é r z!task_done() called too many timesN)r" r# Ú ValueErrorÚ notify_all)r% Ú unfinisheds r Ú task_donezQueue.task_done9 s] € ð × Ó Ø×.Ñ.°Ñ2ˆJؘQŠØ ’>Ü$Ð%HÓIÐIØ×#Ñ#×.Ñ.Ô0Ø$.ˆDÔ!÷ !× Ñ ús �AAÁA%c ó¬ — | j 5 | j r'| j j « | j rŒ'ddd« y# 1 sw Y yxY w)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.joinO s? € ð × Ó Ø×'Ò'Ø×#Ñ#×(Ñ(Ô*ð ×'Ó'÷ !× Ñ ús �3A Á Ac óf — | j 5 | j « cddd« S # 1 sw Y yxY w)ú9Return the approximate size of the queue (not reliable!).N©r Ú_qsizer/ s r ÚqsizezQueue.qsize\ s € à �Z‹ZØ—;‘;“=÷ �ZŠZús �'§0c óh — | j 5 | j « cddd« S # 1 sw Y yxY w)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. Nr3 r/ s r ÚemptyzQueue.emptya s! € ð �Z‹ZØ—{‘{“}Ð$÷ �ZŠZús �(¨1c ó– — | j 5 d| j cxk xr | j « k nc cddd« S # 1 sw Y yxY w)aO Return 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. r N)r r r4 r/ s r Úfullz Queue.fullo s, € ð �Z‹ZØ�t—|‘|Ö4 t§{¡{£}Ô4÷ �ZŠZús �(?¿ANc óö — | j 5 | j dkD �r|s#| j « | j k\ rét ‚|€V| j « | j k\ rÄ| j j « | j « | j k\ rŒ8n‹|dk rt d« ‚t « |z }| j « | j k\ rQ|t « z }|dk rt ‚| j j |« | j « | j k\ rŒQ| j |« | xj dz c_ | j j « ddd« y# 1 sw Y yxY w)a Put 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). r Nú''timeout' must be a non-negative numberç r( )r! r r4 r r. r) ÚtimeÚ_putr# r Únotify)r% ÚitemÚblockÚtimeoutÚendtimeÚ remainings r Úputz Queue.putz s € ð �]‹]Ø�|‰|˜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 �BE/ÂBE/Ä&A