Comments (5)
Hello,
thanks for your interest about Queue library.
I did not have to deal with such behavior since the creation of the library, but it happened in the past.
I would even extend this enhancement to the whole queue by creating a method like peek_rec to peek any record in the queue (as you may also have to search in the whole queue for a duplicate record and making more sense for a LIFO implementation).
I think I could add a peek_previous() method as inline to do exactly what you want (for FIFO implementation).
I could also implement a method to drop any item in the queue, just because more peeking options would exist, but as I would like to keep the library straightforward and fluent as possible, I wouldn't plan to add these drop methods, only peeking on all records would be possible.
What do you think about it?
Thanks for giving thoughts about improving this library!
Regards,
SMFSW
from queue.
Changes made and exemples added...
Thanks for your thoughts/needs about enhancing this library, I (on behalf) of open source community thank you for it!
Just one thing before closing the issue, I would be really enjoying that you would test the changes and see if it fits your needs (using peekPrevious method) before tagging this new version...
Thanks a lot for the idea to improve this tiny library, making it more flexible to ones needs!
Really appreciated, kind regards,
SMFSW
from queue.
Thank you for the fast reply, and the generic implementation. I am going to test it and report back ASAP. Just please give me a few days. Thanks again for your work.
from queue.
Tested, and seems fine, closing the issue. Thanks for your patience.
from queue.
@morcibacsi Thanks a lot for enhancement proposal and tests!
New version is now tagged and should be available through Arduino library manager soon now.
from queue.
Related Issues (16)
- Request: add keyword and function POP HOT 6
- Feature request: interrupt safe HOT 5
- number of records in the queue HOT 1
- get the minimal value in a queue HOT 3
- Here's a more simple example script, in case it's useful to anyone HOT 2
- can't transmit string to queue HOT 2
- Missing definition for size_t
- ESP8266 - error: 'Queue' does not name a type HOT 3
- parallel access of getRemainingCount() / getCount() / nbRecs() HOT 4
- print all members of a static queue HOT 1
- Esp32 compatibility HOT 1
- free() in constructor? HOT 2
- Add unit tests and continuous integration HOT 6
- Publish Doxygen doc to GitHub pages HOT 3
- Limit on data types a Queue may hold? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from queue.