Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting timeout #5

Open
thomashirtz opened this issue Apr 9, 2022 · 1 comment
Open

Supporting timeout #5

thomashirtz opened this issue Apr 9, 2022 · 1 comment

Comments

@thomashirtz
Copy link

thomashirtz commented Apr 9, 2022

Hello!
I wanted to know, when adding an element to a queue that is full, like in this test:

def test():
    shape = (100, 100)
    num_elements = 10

    data = np.random.random(size=shape)
    mbytes = data.nbytes/1_000_000*num_elements

    queue = ArrayQueue(max_mbytes=mbytes)
    for i in range(2*num_elements):
        print(i)
        queue.put(data)

Instead of throwing an error :

Traceback (most recent call last):
  File "D:/Thomas/Python/treequeues/test_treequeues.py", line 99, in <module>
    test()
  File "D:/Thomas/Python/treequeues/test_treequeues.py", line 77, in test
    queue.put(data)
  File "D:\Thomas\Python\treequeues\venv\lib\site-packages\arrayqueues\shared_arrays.py", line 87, in put
    self.check_full()
  File "D:\Thomas\Python\treequeues\venv\lib\site-packages\arrayqueues\shared_arrays.py", line 73, in check_full
    raise Full(
queue.Full: Queue of length 10 full when trying to insert 0, last item read was 0

Would it be possible to be able to hang like multprocessing queue ?

@vigji
Copy link
Member

vigji commented Aug 2, 2023

Very sorry for having completely lost track of everything here. I guess solved by now? Still wanted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants