MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / put

Method put

tools/python-3.11.9-amd64/Lib/queue.py:272–279  ·  view source on GitHub ↗

Put the item on the queue. The optional 'block' and 'timeout' arguments are ignored, as this method never blocks. They are provided for compatibility with the Queue class.

(self, item, block=True, timeout=None)

Source from the content-addressed store, hash-verified

270 self._count = threading.Semaphore(0)
271
272 def put(self, item, block=True, timeout=None):
273 '''Put the item on the queue.
274
275 The optional 'block' and 'timeout' arguments are ignored, as this method
276 never blocks. They are provided for compatibility with the Queue class.
277 '''
278 self._queue.append(item)
279 self._count.release()
280
281 def get(self, block=True, timeout=None):
282 '''Remove and return an item from the queue.

Callers 1

put_nowaitMethod · 0.95

Calls 2

appendMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected