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

Determining length of queue at startup #34

Open
jadamcrain opened this issue Feb 22, 2024 · 2 comments
Open

Determining length of queue at startup #34

jadamcrain opened this issue Feb 22, 2024 · 2 comments

Comments

@jadamcrain
Copy link

Hi! Cool library.

My use case is an IoT system where data is buffered for transmission. In the event of flaky comms, I need to buffer data to disk instead of memory, so this library looks great for this use case. I'm implementing a hybrid memory/disk queue using Yaque and a VecDeque. The idea is that the a fixed amount of memory will be dedicated for buffering, and if the memory limit is exceeded, we'll start buffering to Yaque. Popping elements for transmission will entail loading from Yaque if disk buffering has occurred.

What's the best way to determine the queue length during program initialization?

Is the answer here to just create QueueIter and count them?

@jadamcrain jadamcrain changed the title Determining lenght of queue at startup Determining length of queue at startup Feb 22, 2024
@tokahuke
Copy link
Owner

tokahuke commented Apr 8, 2024

Hey, @jadamcrain see PR #35. Will that solve your issue?

@jadamcrain
Copy link
Author

jadamcrain commented Apr 9, 2024

My use case was more about knowing the # of elements in the queue, rather than the total size of all the elements in bytes. That said, feel free to close the issue. I'm handling this with a different persistent back-end.

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