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

how to get queue length #15

Open
farss opened this issue Sep 15, 2021 · 9 comments
Open

how to get queue length #15

farss opened this issue Sep 15, 2021 · 9 comments

Comments

@farss
Copy link

farss commented Sep 15, 2021

No description provided.

@tokahuke
Copy link
Owner

Queue length is a bit difficult to get atm due to the current architecture. Could you ellaborate on the exact use case to use the queue length explicitly? I have closed a similar issue (issue #7). Is your use case no covered by the features implemented there?

@BradCage1994
Copy link

Hi i also need this functionality. I have limited memory available, so I want to be effective in my memory usage with the queue. The reason I can't use a single queue and limit his size is because I need to implement message pop at complexity of O(1), but I have different message types, and I want to pop message of type A at O(1). For that i want to manage multiple queues with a maximum total size. In order to manage the total size i need to check every queue size.

@tokahuke
Copy link
Owner

tokahuke commented Dec 3, 2021

Oh, dear! Ok, this will be an interesting challenge. I will open a Pull Request, then!

@tokahuke
Copy link
Owner

tokahuke commented Dec 3, 2021

Conceptually, you would need both read and write access to the queue, otherwise, I think we risk creating a race condition. @BradCage1994 do both ends of your queues reside in the same process?

@BradCage1994
Copy link

no they dont

@jeromegn
Copy link

jeromegn commented Nov 8, 2023

Reviving this old issue because it's somewhat related: We'd like to get queue length as well as other "metrics" so we can better monitor our queues.

@barafael
Copy link

barafael commented Apr 5, 2024

yes, this is something we need as well. Directory size in bytes is fine too, though.

@tokahuke
Copy link
Owner

tokahuke commented Apr 8, 2024

Directory size in bytes should be easy-peasy. Hopefully I will be able to focus on this soon. As I said, the real deal would be the exact number of elements. However, it seems that, for most applications this is what people need.

@tokahuke
Copy link
Owner

tokahuke commented Apr 8, 2024

Two years later, we have a PR 🎉 : #35

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

5 participants