Lines Matching full:queue
1 :mod:`Queue` --- A synchronized queue class
4 .. module:: Queue
5 :synopsis: A synchronized queue class.
8 The :mod:`Queue` module has been renamed to :mod:`queue` in Python 3. The
12 **Source code:** :source:`Lib/Queue.py`
16 The :mod:`Queue` module implements multi-producer, multi-consumer queues.
18 exchanged safely between multiple threads. The :class:`~Queue.Queue` class in this
23 The module implements three types of queue, which differ only in the order in
24 which the entries are retrieved. In a FIFO queue, the first tasks added are
25 the first retrieved. In a LIFO queue, the most recently added entry is
26 the first retrieved (operating like a stack). With a priority queue,
30 The :mod:`Queue` module defines the following classes and exceptions:
32 .. class:: Queue(maxsize=0)
34 Constructor for a FIFO queue. *maxsize* is an integer that sets the upperbound
35 limit on the number of items that can be placed in the queue. Insertion will
36 block once this size has been reached, until queue items are consumed. If
37 *maxsize* is less than or equal to zero, the queue size is infinite.
41 Constructor for a LIFO queue. *maxsize* is an integer that sets the upperbound
42 limit on the number of items that can be placed in the queue. Insertion will
43 block once this size has been reached, until queue items are consumed. If
44 *maxsize* is less than or equal to zero, the queue size is infinite.
50 Constructor for a priority queue. *maxsize* is an integer that sets the upperbound
51 limit on the number of items that can be placed in the queue. Insertion will
52 block once this size has been reached, until queue items are consumed. If
53 *maxsize* is less than or equal to zero, the queue size is infinite.
63 Exception raised when non-blocking :meth:`~Queue.get` (or
64 :meth:`~Queue.get_nowait`) is called
65 on a :class:`~Queue.Queue` object which is empty.
70 Exception raised when non-blocking :meth:`~Queue.put` (or
71 :meth:`~Queue.put_nowait`) is called
72 on a :class:`~Queue.Queue` object which is full.
83 Queue Objects
86 Queue objects (:class:`~Queue.Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`)
90 .. method:: Queue.qsize()
92 Return the approximate size of the queue. Note, qsize() > 0 doesn't
97 .. method:: Queue.empty()
99 Return ``True`` if the queue is empty, ``False`` otherwise. If empty()
105 .. method:: Queue.full()
107 Return ``True`` if the queue is full, ``False`` otherwise. If full()
113 .. method:: Queue.put(item[, block[, timeout]])
115 Put *item* into the queue. If optional args *block* is true and *timeout* is
119 Otherwise (*block* is false), put an item on the queue if a free slot is
127 .. method:: Queue.put_nowait(item)
132 .. method:: Queue.get([block[, timeout]])
134 Remove and return an item from the queue. If optional args *block* is true and
145 .. method:: Queue.get_nowait()
153 .. method:: Queue.task_done()
155 Indicate that a formerly enqueued task is complete. Used by queue consumer
157 :meth:`task_done` tells the queue that the processing on the task is complete.
161 that had been :meth:`put` into the queue).
164 the queue.
169 .. method:: Queue.join()
171 Blocks until all items in the queue have been gotten and processed.
173 The count of unfinished tasks goes up whenever an item is added to the queue.
188 q = Queue()