MCPcopy
hub / github.com/tornadoweb/tornado / put_nowait

Method put_nowait

tornado/queues.py:209–223  ·  view source on GitHub ↗

Put an item into the queue without blocking. If no free slot is immediately available, raise `QueueFull`.

(self, item: _T)

Source from the content-addressed store, hash-verified

207 return future
208
209 def put_nowait(self, item: _T) -> None:
210 """Put an item into the queue without blocking.
211
212 If no free slot is immediately available, raise `QueueFull`.
213 """
214 self._consume_expired()
215 if self._getters:
216 assert self.empty(), "queue non-empty, why are getters waiting?"
217 getter = self._getters.popleft()
218 self.__put_internal(item)
219 future_set_result_unless_cancelled(getter, self._get())
220 elif self.full():
221 raise QueueFull
222 else:
223 self.__put_internal(item)
224
225 def get(
226 self, timeout: Optional[Union[float, datetime.timedelta]] = None

Callers 15

putMethod · 0.95
test_orderMethod · 0.95
test_blocking_getMethod · 0.95
test_nonblocking_getMethod · 0.95
test_get_with_puttersMethod · 0.95
test_get_timeoutMethod · 0.95
test_put_timeoutMethod · 0.95
test_float_maxsizeMethod · 0.95
test_task_doneMethod · 0.80

Calls 6

_consume_expiredMethod · 0.95
emptyMethod · 0.95
__put_internalMethod · 0.95
_getMethod · 0.95
fullMethod · 0.95

Tested by 14

test_orderMethod · 0.76
test_blocking_getMethod · 0.76
test_nonblocking_getMethod · 0.76
test_get_with_puttersMethod · 0.76
test_get_timeoutMethod · 0.76
test_put_timeoutMethod · 0.76
test_float_maxsizeMethod · 0.76
test_task_doneMethod · 0.64
test_task_done_delayMethod · 0.64