yaque icon indicating copy to clipboard operation
yaque copied to clipboard

Determining length of queue at startup

Open jadamcrain opened this issue 2 years ago • 2 comments

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 avatar Feb 22 '24 22:02 jadamcrain

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

tokahuke avatar Apr 08 '24 15:04 tokahuke

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.

jadamcrain avatar Apr 09 '24 05:04 jadamcrain