Files
PowerToys/PythonHome/Lib/Queue.pyc

78 lines
10 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s<>dZddlmZyddlZWnek
rEddlZnXddlmZddl Z ddddd gZ
de fd
<00><00>YZ de fd <00><00>YZ ddd <00><00>YZdefd <00><00>YZd efd<00><00>YZdS(s'A multi-producer, multi-consumer queue.i<><69><EFBFBD><EFBFBD>(ttimeN(tdequetEmptytFulltQueuet PriorityQueuet LifoQueuecBseZdZRS(s4Exception raised by Queue.get(block=0)/get_nowait().(t__name__t
2014-07-10 23:57:08 +08:00
__module__t__doc__(((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR scBseZdZRS(s4Exception raised by Queue.put(block=0)/put_nowait().(RRR (((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyRscBs<>eZdZdd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Ze dd<00>Z d <00>Z e dd
2014-07-09 18:15:23 +08:00
<00>Z d <00>Zd <00>Zed <00>Zd<00>Zd<00>ZRS(sjCreate a queue object with a given maximum size.
If maxsize is <= 0, the queue size is infinite.
icCsq||_|j|<00>tj<00>|_tj|j<00>|_tj|j<00>|_tj|j<00>|_d|_ dS(Ni(
tmaxsizet_initt
_threadingtLocktmutext Conditiont not_emptytnot_fulltall_tasks_donetunfinished_tasks(tselfR
2014-07-10 23:57:08 +08:00
((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyt__init__s  cCss|jj<00>zQ|jd}|dkrT|dkrDtd<00><00>n|jj<00>n||_Wd|jj<00>XdS(s.Indicate that a formerly enqueued task is complete.
2014-07-09 18:15:23 +08:00
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.
iis!task_done() called too many timesN(RtacquireRt
ValueErrort
notify_alltrelease(Rt
2014-07-10 23:57:08 +08:00
unfinished((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyt task_done-s     cCsC|jj<00>z!x|jr,|jj<00>qWWd|jj<00>XdS(s<>Blocks until all items in the Queue have been gotten and processed.
2014-07-09 18:15:23 +08:00
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.
2014-07-10 23:57:08 +08:00
N(RRRtwaitR(R((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pytjoinFs
 cCs*|jj<00>|j<00>}|jj<00>|S(s9Return the approximate size of the queue (not reliable!).(RRt_qsizeR(Rtn((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pytqsizeVs   cCs+|jj<00>|j<00> }|jj<00>|S(sCReturn True if the queue is empty, False otherwise (not reliable!).(RRRR(RR((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pytempty]s   cCsC|jj<00>d|jko-|j<00>kn}|jj<00>|S(sBReturn True if the queue is full, False otherwise (not reliable!).i(RRR
RR(RR((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pytfullds % cCs6|jj<00>z|jdkr<>|sF|j<00>|jkr<>t<00>q<>q<>|dkr~x<>|j<00>|jkrz|jj<00>qUWq<57>|dkr<>td<00><00>q<>t<00>|}xN|j<00>|jkr<>|t<00>}|dkr<>t<00>n|jj|<00>q<>Wn|j |<00>|j
2014-07-09 18:15:23 +08:00
d7_
|j j <00>Wd|jj <00>XdS(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 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).
is''timeout' must be a non-negative numbergiN(RRR
2014-07-10 23:57:08 +08:00
RRtNoneRRt_timet_putRRtnotifyR(Rtitemtblockttimeouttendtimet remaining((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pytputks*         cCs|j|t<00>S(s<>Put an item into the queue without blocking.
2014-07-09 18:15:23 +08:00
Only enqueue the item if a free slot is immediately available.
Otherwise raise the Full exception.
2014-07-10 23:57:08 +08:00
(R,tFalse(RR'((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyt
2014-07-09 18:15:23 +08:00
put_nowait<69>scCs<>|jj<00>z<>|s.|j<00>s<>t<00>q<>n<>|dkr]x<>|j<00>sY|jj<00>q=Wnm|dkrxtd<00><00>nRt<00>|}xB|j<00>s<>|t<00>}|dkr<>t<00>n|jj|<00>q<>W|j<00>}|j j
<00>|SWd|jj <00>XdS(sRemove 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).
2014-07-10 23:57:08 +08:00
is''timeout' must be a non-negative numbergN( RRRRR#RRR$t_getRR&R(RR(R)R*R+R'((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pytget<65>s(           cCs |jt<00>S(s<>Remove and return an item from the queue without blocking.
2014-07-09 18:15:23 +08:00
Only get an item if one is immediately available. Otherwise
raise the Empty exception.
2014-07-10 23:57:08 +08:00
(R0R-(R((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyt
2014-07-09 18:15:23 +08:00
get_nowait<69>scCst<00>|_dS(N(Rtqueue(RR
2014-07-10 23:57:08 +08:00
((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR <00>scCs ||j<00>S(N(R2(Rtlen((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR<00>scCs|jj|<00>dS(N(R2tappend(RR'((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR%<00>scCs |jj<00>S(N(R2tpopleft(R((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR/<00>sN(RRR RRRR R!R"tTrueR#R,R.R0R1R R3RR%R/(((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyRs      # "   cBsAeZdZd<00>Zed<00>Zejd<00>Zej d<00>Z
2014-07-09 18:15:23 +08:00
RS(s<>Variant of Queue that retrieves open entries in priority order (lowest first).
Entries are typically tuples of the form: (priority number, data).
cCs g|_dS(N(R2(RR
2014-07-10 23:57:08 +08:00
((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR <00>scCs ||j<00>S(N(R2(RR3((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR<00>scCs||j|<00>dS(N(R2(RR'theappush((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR%<00>scCs ||j<00>S(N(R2(Rtheappop((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR/<00>s( RRR R R3RtheapqR7R%R8R/(((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR<00>s
2014-07-09 18:15:23 +08:00
  cBs5eZdZd<00>Zed<00>Zd<00>Zd<00>ZRS(sBVariant of Queue that retrieves most recently added entries first.cCs g|_dS(N(R2(RR
2014-07-10 23:57:08 +08:00
((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR <00>scCs ||j<00>S(N(R2(RR3((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR<00>scCs|jj|<00>dS(N(R2R4(RR'((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR%<00>scCs |jj<00>S(N(R2tpop(R((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR/<00>s(RRR R R3RR%R/(((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyR<00>s
   ((R RR$t threadingR t ImportErrortdummy_threadingt collectionsRR9t__all__t ExceptionRRRRR(((s:e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\Queue.pyt<module>s  <13>