ray.util.queue.Queue.get_async#
- async Queue.get_async(block: bool = True, timeout: float | None = None) Any[source]#
Gets an item from the queue.
There is no guarantee of order if multiple consumers get from the same empty queue.
- Parameters:
block – If True, wait up to
timeoutfor an item to become available. If False, raiseEmptyimmediately when the queue is empty.timeout – Maximum number of seconds to wait when
blockis True.Nonewaits forever.
- Returns:
The next item in the queue.
- Raises:
Empty – if the queue is empty and blocking is False.
Empty – if the queue is empty, blocking is True, and it timed out.
ValueError – if timeout is negative.