Looking for maintainers - please reach out!
This package is to be archived due to inability to find contributors, thanks to everyone who helped make it possible.
If you're looking for an alternative, we highly recommend Meteor-Files by VeliovGroup
MicroQueue is a simple LIFO or FIFO queue. It's faster than a simple array with pop
/shift
because shift
is O(n)
and can become slow with a large array.
This queue was built as a spinal-queue for the PowerQueue
package. The interface is very basic and consists of add
, get
, and reset
, making it possible to write a custom micro-queue for PowerQueue
, such as a queue that is persisted into a database.
Note: MicroQueue can be used with
PowerQueue
butMicroQueue
lacks the properties of n key ordered list - It does try to compensate when reinserting keys - this is especially optimized for the PowerQueue
And... It's powered by Meteor's reactive sugar :)
Kind regards Eric(@aldeed) and Morten(@raix)
Happy coding!!
#API API Documentation
From the docs:
Arguments
- lifo {boolean} (Optional = false)
Set true for
lifo
, default isfifo
var foo = new MicroQueue(); // Basic FIFO queue
foo.add(1);
foo.add(2);
foo.add(3);
for (var i = 0; i < foo.length(); i++) {
console.log(foo.get());
}
The result should be: "1, 2, 3".
MicroQueue = function(lifo) { ...
See micro-queue.js:24.
Here's the complete API documentation, including private methods.
To update the docs, run npm install docmeteor
then
$ docmeteor