MCPcopy Create free account
hub / github.com/EasyIME/PIME / get_nowait

Method get_nowait

python/python3/tornado/queues.py:256–272  ·  view source on GitHub ↗

Remove and return an item from the queue without blocking. Return an item if one is immediately available, else raise `QueueEmpty`.

(self)

Source from the content-addressed store, hash-verified

254 return future
255
256 def get_nowait(self) -> _T:
257 """Remove and return an item from the queue without blocking.
258
259 Return an item if one is immediately available, else raise
260 `QueueEmpty`.
261 """
262 self._consume_expired()
263 if self._putters:
264 assert self.full(), "queue not full, why are putters waiting?"
265 item, putter = self._putters.popleft()
266 self.__put_internal(item)
267 future_set_result_unless_cancelled(putter, None)
268 return self._get()
269 elif self.qsize():
270 return self._get()
271 else:
272 raise QueueEmpty
273
274 def task_done(self) -> None:
275 """Indicate that a formerly enqueued task is complete.

Callers 8

getMethod · 0.95
test_orderMethod · 0.95
test_nonblocking_getMethod · 0.95
test_blocking_putMethod · 0.95
test_put_timeoutMethod · 0.95
test_float_maxsizeMethod · 0.95
test_orderMethod · 0.80
test_orderMethod · 0.80

Calls 6

_consume_expiredMethod · 0.95
fullMethod · 0.95
__put_internalMethod · 0.95
_getMethod · 0.95
qsizeMethod · 0.95

Tested by 7

test_orderMethod · 0.76
test_nonblocking_getMethod · 0.76
test_blocking_putMethod · 0.76
test_put_timeoutMethod · 0.76
test_float_maxsizeMethod · 0.76
test_orderMethod · 0.64
test_orderMethod · 0.64