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

Get size of FifoDiskQueue, peak, empty it #18

Open
etayluz opened this issue Apr 21, 2017 · 3 comments
Open

Get size of FifoDiskQueue, peak, empty it #18

etayluz opened this issue Apr 21, 2017 · 3 comments

Comments

@etayluz
Copy link

etayluz commented Apr 21, 2017

Is there a way to:

  • Get size of FifoDiskQueue
  • Empty out FifoDiskQueue completely
  • Peak at the head of FifoDiskQueue without popping it
  • Tell if it's empty

Thanks!

@Gallaecio
Copy link
Member

@dangra Should we extend queue interfaces with this?

@MatthewScholefield
Copy link

Came to mention the same thing. Looking at the code it seems quite simple to implement peek by doing everything in pop without writing back to info. Also looks like you can get the size with q.info['size']. Should be similarly easy for the sql based queue. Personally, I think this would be a preferable addition.

@Gallaecio, @dangra would this be a welcome addition if I were to submit a PR?

@elacuesta
Copy link
Member

Update: the only feature currently missing is "Empty out FifoDiskQueue completely". Out of the initial 4 proposed features:

  1. Get size of FifoDiskQueue
  2. Empty out FifoDiskQueue completely
  3. Peak at the head of FifoDiskQueue without popping it
  4. Tell if it's empty

(1) and (4) have been available since the initial commit, and (3) was added in #38 (not yet released at the time of writing).

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

No branches or pull requests

4 participants