Understanding the working of ray Queue

Following is my ray Queue code snippet.

import ray
from ray.util.queue import Queue as Queue
from ray.util.queue import Full,Empty as Full, Empty


queue = Queue(maxsize=5)

def consumer(queue):
    next_item = queue.get()
    print(f"got work {next_item}")
    return next_item * next_item

consumers = [consumer.remote(queue) for _ in range(5)]

for i in range(10):
        queue.put(i, block=False)

except ray.util.queue.Full:
    print("queue is full")
    # Do some logic


My requirement is similar to the above code snippet. I have a queue size of x , data size will be 2x . After writing x amount of data to the queue . I need to execute my business logic using ray.get and retrieve data. Then again perform ray.get on the other x amount of data.

I have tried to simulate it above , but the behavior is not as expected, after writing 5 elements to the queue , it raises exception. Does ray.get gives response. After exiting out of the loop again wth ray.get prints same data again.