Lines Matching +full:remove +full:- +full:item
1 '''A multi-producer, multi-consumer queue.'''
44 # Notify not_empty whenever an item is added to the queue; a
48 # Notify not_full whenever an item is removed from the queue;
66 for every item that had been put() into the queue).
72 unfinished = self.unfinished_tasks - 1
82 The count of unfinished tasks goes up whenever an item is added to the
84 to indicate the item was retrieved and all work on it is complete.
122 def put(self, item, block=True, timeout=None): argument
123 '''Put an item into the queue.
127 a non-negative number, it blocks at most 'timeout' seconds and raises
129 Otherwise ('block' is false), put an item on the queue if a free slot
142 raise ValueError("'timeout' must be a non-negative number")
146 remaining = endtime - time()
150 self._put(item)
155 '''Remove and return an item from the queue.
158 block if necessary until an item is available. If 'timeout' is
159 a non-negative number, it blocks at most 'timeout' seconds and raises
160 the Empty exception if no item was available within that time.
161 Otherwise ('block' is false), return an item if one is immediately
173 raise ValueError("'timeout' must be a non-negative number")
177 remaining = endtime - time()
181 item = self._get()
183 return item
185 def put_nowait(self, item): argument
186 '''Put an item into the queue without blocking.
188 Only enqueue the item if a free slot is immediately available.
191 return self.put(item, block=False)
194 '''Remove and return an item from the queue without blocking.
196 Only get an item if one is immediately available. Otherwise
212 # Put a new item in the queue
213 def _put(self, item): argument
214 self.queue.append(item)
216 # Get an item from the queue
235 def _put(self, item): argument
236 heappush(self.queue, item)
251 def _put(self, item): argument
252 self.queue.append(item)
272 def put(self, item, block=True, timeout=None): argument
273 '''Put the item on the queue.
278 self._queue.append(item)
282 '''Remove and return an item from the queue.
285 block if necessary until an item is available. If 'timeout' is
286 a non-negative number, it blocks at most 'timeout' seconds and raises
287 the Empty exception if no item was available within that time.
288 Otherwise ('block' is false), return an item if one is immediately
293 raise ValueError("'timeout' must be a non-negative number")
298 def put_nowait(self, item): argument
299 '''Put an item into the queue without blocking.
301 This is exactly equivalent to `put(item, block=False)` and is only provided
304 return self.put(item, block=False)
307 '''Remove and return an item from the queue without blocking.
309 Only get an item if one is immediately available. Otherwise