MCPcopy Index your code
hub / github.com/python/cpython / get_nowait

Method get_nowait

Lib/asyncio/queues.py:203–217  ·  view source on GitHub ↗

Remove and return an item from the queue. Return an item if one is immediately available, else raise QueueEmpty. Raises QueueShutDown if the queue has been shut down and is empty, or if the queue has been shut down immediately.

(self)

Source from the content-addressed store, hash-verified

201 return self.get_nowait()
202
203 def get_nowait(self):
204 """Remove and return an item from the queue.
205
206 Return an item if one is immediately available, else raise QueueEmpty.
207
208 Raises QueueShutDown if the queue has been shut down and is empty, or
209 if the queue has been shut down immediately.
210 """
211 if self.empty():
212 if self._is_shutdown:
213 raise QueueShutDown
214 raise QueueEmpty
215 item = self._get()
216 self._wakeup_next(self._putters)
217 return item
218
219 def task_done(self):
220 """Indicate that a formerly enqueued task is complete.

Callers 15

getMethod · 0.95
test_getMethod · 0.95
test_queue_getMethod · 0.95
_test_repr_or_strMethod · 0.95
test_nonblocking_getMethod · 0.95
test_nonblocking_putMethod · 0.95
test_put_cancel_dropMethod · 0.95
test_nowaitMethod · 0.45

Calls 3

emptyMethod · 0.95
_getMethod · 0.95
_wakeup_nextMethod · 0.95

Tested by 15

test_getMethod · 0.76
test_queue_getMethod · 0.76
_test_repr_or_strMethod · 0.76
test_nonblocking_getMethod · 0.76
test_nonblocking_putMethod · 0.76
test_put_cancel_dropMethod · 0.76
test_nowaitMethod · 0.36
_shutdown_put_joinMethod · 0.36