Queue.put(item: Any, block: bool = True, timeout: float | None = None) None[source]#

Adds an item to the queue.

If block is True and the queue is full, blocks until the queue is no longer full or until timeout.

There is no guarantee of order if multiple producers put to the same full queue.

  • Full – if the queue is full and blocking is False.

  • Full – if the queue is full, blocking is True, and it timed out.

  • ValueError – if timeout is negative.