î i fƒ" ã @ s d Z y d d l Z Wn e k r6 d d l Z Yn Xd d l m Z d d l m Z m Z y d d l m Z Wn" e k r• d d l m Z Yn Xd d d d d g Z Gd d „ d e ƒ Z Gd d „ d e ƒ Z Gd d „ d ƒ Z Gd d „ d e ƒ Z Gd d „ d e ƒ Z d S)z'A multi-producer, multi-consumer queue.é N)Údeque)ÚheappushÚheappop)Ú monotonic)ÚtimeÚEmptyÚFullÚQueueÚ PriorityQueueÚ LifoQueuec @ s e Z d Z d Z d S)r z4Exception raised by Queue.get(block=0)/get_nowait().N)Ú__name__Ú __module__Ú__qualname__Ú__doc__© r r ú*/opt/alt/python34/lib64/python3.4/queue.pyr s c @ s e Z d Z d Z d S)r z4Exception raised by Queue.put(block=0)/put_nowait().N)r r r r r r r r r s c @ sÍ e Z d Z d Z d d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d d d „ Z d d d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d S)!r zjCreate a queue object with a given maximum size. If maxsize is <= 0, the queue size is infinite. r c C sq | | _ | j | ƒ t j ƒ | _ t j | j ƒ | _ t j | j ƒ | _ t j | j ƒ | _ d | _ d S)Nr ) ÚmaxsizeÚ_initÚ threadingZLockÚmutexZ ConditionÚ not_emptyÚnot_fullÚall_tasks_doneÚunfinished_tasks)Úselfr r r r Ú__init__ s zQueue.__init__c C sa | j �R | j d } | d k rN | d k r> t d ƒ ‚ n | j j ƒ n | | _ Wd QXd S)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 Ú ValueErrorZ notify_all)r Z unfinishedr r r Ú task_done5 s zQueue.task_donec C s1 | j �" x | j r&