Lines Matching full:queue

1 :mod:`queue` --- A synchronized queue class
4 .. module:: queue
5 :synopsis: A synchronized queue class.
7 **Source code:** :source:`Lib/queue.py`
11 The :mod:`queue` module implements multi-producer, multi-consumer queues.
13 exchanged safely between multiple threads. The :class:`Queue` class in this
18 The module implements three types of queue, which differ only in the order in
20 queue, the first tasks added are the first retrieved. In a
21 :abbr:`LIFO (last-in, first-out)` queue, the most recently added entry is
22 the first retrieved (operating like a stack). With a priority queue,
31 :abbr:`FIFO (first-in, first-out)` queue type, :class:`SimpleQueue`, whose
35 The :mod:`queue` module defines the following classes and exceptions:
37 .. class:: Queue(maxsize=0)
39 Constructor for a :abbr:`FIFO (first-in, first-out)` queue. *maxsize* is
41 limit on the number of items that can be placed in the queue. Insertion will
42 block once this size has been reached, until queue items are consumed. If
43 *maxsize* is less than or equal to zero, the queue size is infinite.
47 Constructor for a :abbr:`LIFO (last-in, first-out)` queue. *maxsize* is
49 limit on the number of items that can be placed in the queue. Insertion will
50 block once this size has been reached, until queue items are consumed. If
51 *maxsize* is less than or equal to zero, the queue size is infinite.
56 Constructor for a priority queue. *maxsize* is an integer that sets the upperbound
57 limit on the number of items that can be placed in the queue. Insertion will
58 block once this size has been reached, until queue items are consumed. If
59 *maxsize* is less than or equal to zero, the queue size is infinite.
78 Constructor for an unbounded :abbr:`FIFO (first-in, first-out)` queue.
86 Exception raised when non-blocking :meth:`~Queue.get` (or
87 :meth:`~Queue.get_nowait`) is called
88 on a :class:`Queue` object which is empty.
93 Exception raised when non-blocking :meth:`~Queue.put` (or
94 :meth:`~Queue.put_nowait`) is called
95 on a :class:`Queue` object which is full.
100 Queue Objects
103 Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`)
107 .. method:: Queue.qsize()
109 Return the approximate size of the queue. Note, qsize() > 0 doesn't
114 .. method:: Queue.empty()
116 Return ``True`` if the queue is empty, ``False`` otherwise. If empty()
122 .. method:: Queue.full()
124 Return ``True`` if the queue is full, ``False`` otherwise. If full()
130 .. method:: Queue.put(item, block=True, timeout=None)
132 Put *item* into the queue. If optional args *block* is true and *timeout* is
136 Otherwise (*block* is false), put an item on the queue if a free slot is
141 .. method:: Queue.put_nowait(item)
146 .. method:: Queue.get(block=True, timeout=None)
148 Remove and return an item from the queue. If optional args *block* is true and
156 .. method:: Queue.get_nowait()
164 .. method:: Queue.task_done()
166 Indicate that a formerly enqueued task is complete. Used by queue consumer
168 :meth:`task_done` tells the queue that the processing on the task is complete.
172 that had been :meth:`put` into the queue).
175 the queue.
178 .. method:: Queue.join()
180 Blocks until all items in the queue have been gotten and processed.
182 The count of unfinished tasks goes up whenever an item is added to the queue.
198 q = queue.Queue()
225 Return the approximate size of the queue. Note, qsize() > 0 doesn't
231 Return ``True`` if the queue is empty, ``False`` otherwise. If empty()
238 Put *item* into the queue. The method never blocks and always succeeds
241 for compatibility with :meth:`Queue.put`.
247 state inside the queue. This makes it appropriate for use in
254 :meth:`Queue.put_nowait`.
259 Remove and return an item from the queue. If optional args *block* is true and
274 Class :class:`multiprocessing.Queue`
275 A queue class for use in a multi-processing (rather than multi-threading)