PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  oY@sdZdddddgZddlZddlZdd lmZdd lmZdd lmZdd lm Z Gd dde Z Gddde Z GdddZ Gddde ZGddde Zejse ZejddS)ZQueuesQueue PriorityQueue LifoQueue QueueFull QueueEmptyN)compat)events)locks) coroutinec@seZdZdZdS)rz]Exception raised when Queue.get_nowait() is called on a Queue object which is empty. N)__name__ __module__ __qualname____doc__rr%/opt/python35/lib/python3.5/queues.pyrs c@seZdZdZdS)rzgException raised when the Queue.put_nowait() method is called on a Queue object which is full. N)r r rrrrrrrs c@seZdZdZdddddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ e ddZddZddZeddZdd Zed!d"Zd#d$Zd%d&Zed'd(ZdS))ra A queue, useful for coordinating producer and consumer coroutines. If maxsize is less than or equal to zero, the queue size is infinite. If it is an integer greater than 0, then "yield from put()" will block when the queue reaches maxsize, until an item is removed by get(). Unlike the standard library Queue, you can reliably know this Queue's size with qsize(), since your single-threaded asyncio application won't be interrupted between calling qsize() and doing an operation on the Queue. rloopNcCs|dkrtj|_n ||_||_tj|_tj|_d|_t j d|j|_ |j j |j |dS)Nrr)r Zget_event_loop_loop_maxsize collectionsdeque_getters_putters_unfinished_tasksr Event _finishedset_init)selfmaxsizerrrr__init__(s     zQueue.__init__cCstj|_dS)N)rr_queue)rrrrrr:sz Queue._initcCs |jjS)N)r!popleft)rrrr_get=sz Queue._getcCs|jj|dS)N)r!append)ritemrrr_put@sz Queue._putcCs7x0|r2|j}|js|jdPqWdS)N)r"done set_result)rwaiterswaiterrrr _wakeup_nextEs     zQueue._wakeup_nextcCs(djt|jt||jS)Nz<{} at {:#x} {}>)formattyper id_format)rrrr__repr__MszQueue.__repr__cCsdjt|j|jS)Nz<{} {}>)r,r-r r/)rrrr__str__Qsz Queue.__str__cCsdj|j}t|ddr@|djt|j7}|jre|djt|j7}|jr|djt|j7}|jr|dj|j7}|S)Nz maxsize={!r}r!z _queue={!r}z _getters[{}]z _putters[{}]z tasks={}) r,rgetattrlistr!rlenrr)rresultrrrr/Ts   z Queue._formatcCs t|jS)zNumber of items in the queue.)r4r!)rrrrqsize`sz Queue.qsizecCs|jS)z%Number of items allowed in the queue.)r)rrrrrdsz Queue.maxsizecCs|j S)z3Return True if the queue is empty, False otherwise.)r!)rrrremptyisz Queue.emptycCs*|jdkrdS|j|jkSdS)zReturn True if there are maxsize items in the queue. Note: if the Queue was initialized with maxsize=0 (the default), then full() is never True. rFN)rr6)rrrrfullmsz Queue.fullc csx~|jr|jj}|jj|y |EdHWq|j|j ru|j ru|j|jYqXqW|j|S)zPut an item into the queue. Put an item into the queue. If the queue is full, wait until a free slot is available before adding item. This method is a coroutine. N) r8r create_futurerr$cancel cancelledr+ put_nowait)rr%Zputterrrrputxs    z Queue.putcCsO|jrt|j||jd7_|jj|j|jdS)zyPut an item into the queue without blocking. If no free slot is immediately available, raise QueueFull. rN)r8rr&rrclearr+r)rr%rrrr<s    zQueue.put_nowaitc csx~|jr|jj}|jj|y |EdHWq|j|j ru|j ru|j|jYqXqW|jS)zRemove and return an item from the queue. If queue is empty, wait until an item is available. This method is a coroutine. N) r7rr9rr$r:r;r+ get_nowait)rgetterrrrgets   z Queue.getcCs2|jrt|j}|j|j|S)zRemove and return an item from the queue. Return an item if one is immediately available, else raise QueueEmpty. )r7rr#r+r)rr%rrrr?s   zQueue.get_nowaitcCsJ|jdkrtd|jd8_|jdkrF|jjdS)a$Indicate that a formerly enqueued task is complete. Used by queue consumers. 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 ValueError if called more times than there were items placed in the queue. rz!task_done() called too many timesrN)r ValueErrorrr)rrrr task_dones  zQueue.task_doneccs%|jdkr!|jjEdHdS)aBlock 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 calls task_done() to indicate that the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks. rN)rrwait)rrrrjoins z Queue.join)r r rrr rr#r&r+r0r1r/r6propertyrr7r8r r=r<rAr?rCrErrrrrs&            c@sFeZdZdZddZejddZejddZ dS) rzA subclass of Queue; retrieves entries in priority order (lowest first). Entries are typically tuples of the form: (priority number, data). cCs g|_dS)N)r!)rrrrrrszPriorityQueue._initcCs||j|dS)N)r!)rr%heappushrrrr&szPriorityQueue._putcCs ||jS)N)r!)rheappoprrrr#szPriorityQueue._getN) r r rrrheapqrGr&rHr#rrrrrs  c@s:eZdZdZddZddZddZdS) rzEA subclass of Queue that retrieves most recently added entries first.cCs g|_dS)N)r!)rrrrrrszLifoQueue._initcCs|jj|dS)N)r!r$)rr%rrrr&szLifoQueue._putcCs |jjS)N)r!pop)rrrrr#szLifoQueue._getN)r r rrrr&r#rrrrrs    JoinableQueue)r__all__rrIrr r Z coroutinesr ExceptionrrrrrZPY35rKr$rrrrs