• Home
  • Raw
  • Download

Lines Matching +full:get +full:- +full:item

1 """A multi-producer, multi-consumer queue."""
14 "Exception raised by Queue.get(block=0)/get_nowait()."
34 # Notify not_empty whenever an item is added to the queue; a
35 # thread waiting to get is notified then.
37 # Notify not_full whenever an item is removed from the queue;
48 Used by Queue consumer threads. For each get() used to fetch a task,
54 for every item that had been put() into the queue).
61 unfinished = self.unfinished_tasks - 1
73 The count of unfinished tasks goes up whenever an item is added to the
75 to indicate the item was retrieved and all work on it is complete.
107 def put(self, item, block=True, timeout=None): argument
108 """Put an item into the queue.
112 a non-negative number, it blocks at most 'timeout' seconds and raises
114 Otherwise ('block' is false), put an item on the queue if a free slot
128 raise ValueError("'timeout' must be a non-negative number")
132 remaining = endtime - _time()
136 self._put(item)
142 def put_nowait(self, item): argument
143 """Put an item into the queue without blocking.
145 Only enqueue the item if a free slot is immediately available.
148 return self.put(item, False)
150 def get(self, block=True, timeout=None): member in Queue
151 """Remove and return an item from the queue.
154 block if necessary until an item is available. If 'timeout' is
155 a non-negative number, it blocks at most 'timeout' seconds and raises
156 the Empty exception if no item was available within that time.
157 Otherwise ('block' is false), return an item if one is immediately
170 raise ValueError("'timeout' must be a non-negative number")
174 remaining = endtime - _time()
178 item = self._get()
180 return item
185 """Remove and return an item from the queue without blocking.
187 Only get an item if one is immediately available. Otherwise
190 return self.get(False)
203 # Put a new item in the queue
204 def _put(self, item): argument
205 self.queue.append(item)
207 # Get an item from the queue
224 def _put(self, item, heappush=heapq.heappush): argument
225 heappush(self.queue, item)
240 def _put(self, item): argument
241 self.queue.append(item)